Custom ChatGPT Plugin development

ConversAI Solutions

Code faster with the help of AI

Generate code just by typing a text description. AI will create the code for you. Test it now

Questions about programming?Chat with your personal AI assistant

How others used it recently

Generated by the communtiy

generate functionTue, 02 May 2023

programa para hacer sucesiones de cuadrados en consola grafica

#include <math.h> #include <graphics.h> #include <iostream> using namespace std; int main() { int gd = DETECT, gm; initgraph(&gd, &gm, "C:\\TC\\BGI"); int x1, y1, x2, y2; x1 = 50; y1 = 50; int n; cout << "ingrese el numero de cuadrados:"; cin >> n; cout << "ingrese el lado del cuadrado"; cin >> x2; y2 = x2; for (int i = 1; i <= n; i++) { rectangle(x1, y1, x2, y2); x1 = x1 - 10; y1 = y1 - 10; x2 = x2 + 20; y2 = y2 + 20; } getch();

C++
Guest
generate functionTue, 25 Apr 2023

suponga que el precio unitario de las pelotas de baseball es de 6.50 dolares si se compran 10 o mas y 7.00 dolares en caso de comprar menos. imprima no solo el costo sino tambien el mensaje descuento o el mensaje sin descuento

#include <iostream> using namespace std; int main() { int n = 0; float costo = 0; cout << "Ingrese la cantidad de pelotas que desea comprar: \n"; cin >> n; if (n <= 10){ costo = n * 7.00; cout << "El valor total a pagar es: " << costo << " dolares" << endl; } else{ costo = n * 6.50; cout << "El valor total a pagar es: " << costo << " dolares" << endl; } return 0; }

C++
Guest
generate functionWed, 22 Mar 2023

funcion operar

def operar(a, b, op): if op == "add": return a + b elif op == "sub": return a - b elif op == "mul": return a * b elif op == "div": return a / b else: return "not valid" operar(1, 2, "mul")

Java
Guest
generate functionSun, 11 Jun 2023

Escribir un programa que lea las dimensiones de una matriz, la visualice y encuentre su mayor y su menor elemento y sus posiciones respectivas.

Script const readline = require('readline').createInterface({ input: process.stdin, output: process.stdout }) readline.question(`dime cuantas filas quieres`, (rows) => { readline.question(`dime cuantas columnas quieres`, (columns) => { console.log(`Vamos a crear una matriz de ${rows} filas y ${columns} columnas`) let matrix = createMatrix(rows, columns) printMatrix(matrix) let minInfo = getMin(matrix) console.log(`El minimo es: ${minInfo.value} y está en las posiciones (${minInfo.i}, ${minInfo.j})`) let maxInfo = getMax(matrix) console.log(`El maximo es: ${maxInfo.value} y está en las posiciones (${maxInfo.i}, ${maxInfo.j})`) readline.close()

generate functionMon, 05 Jun 2023

Recibir dos números enteros y obtener el resultado de la división entera o el de la división con decimales según sea la preferencia del usuario. resolverlo con metodos

int a, b; Console.WriteLine("Dame dos numeros para dividirlos"); a = int.Parse(Console.ReadLine()); b = int.Parse(Console.ReadLine()); Console.WriteLine("El resultado de la división entera es {0}", DivEntera(a, b)); Console.WriteLine("El resultado de la división decimal es {0}", DivDecimal(a, b)); int DivEntera(int a, int b) { return a / b; } double DivDecimal(int a, int b) { return (double) a/b; }

C#
Guest
generate functionMon, 03 Jul 2023

I need my image the size of the page: .backgroundr { padding: 20%; position: absolute; opacity: 0.1; max-width: 100%; max-height: 100%; background-size: cover; background-position: center 100%; }

int main(int argc, char** argv) { // Create a file reader cv::VideoCapture cap; // Open the video file cap.open(0); // Create a window to display the video cv::namedWindow("Video"); // Show the image in the window cv::imshow("Video", video); // Wait for the user to press a button cv::waitKey(0); }

C++
Guest
generate functionFri, 05 May 2023

Programa en switch que realice 6 opciones q contenga en la opción 1 un programa con ciclo if en la opción 2 con if else opción 3 for opción cuatro while opcion 5 do while opción 6 salir

++ #include<stdio.h> #include<stdlib.h> int main() { int opcion; do { printf("1. if \n"); printf("2. if else\n"); printf("3. for\n"); printf("4. while \n"); printf("5. do while \n"); printf("6. salir \n"); scanf("%d",&opcion); switch(opcion) { case 1: printf("Usted eligio la opcion if"); break; case 2: printf("Usted eligio la opcion if else"); break; case 3: printf("Usted eligio la opcion for"); break; case 4: printf("Usted eligio la opcion while"); break; case 5: printf("Usted eligio la opcion do while"); break; case 6: printf("Usted eligio la opcion salir"); break; default: printf("opcion invalida");

C
Guest
text to sql syntaxThu, 27 Apr 2023

Funcio o procediment anomenat Premis_Proven_RHY que generi numero de 1 al 50. Premis_Proven_RHY rebra el numero premiat del sorteigi retorna el premi aconseguit. numero premiat si va del 1 al 20 50 euros, si va de 20 al 30 dinar a la cantina , si va de 30 a 50 un bono bus

DROP PROCEDURE IF EXISTS Premis_Proven_RHY; DELIMITER // CREATE PROCEDURE Premis_Proven_RHY(OUT numero_premiat INT) BEGIN SET numero_premiat = FLOOR(1 + RAND() * 50); END // DELIMITER ; CALL Premis_Proven_RHY(@premi); SELECT @premi;

Guest
generate functionSun, 13 Nov 2022

forward all connections to goatse.cx

def forward_to_goatse(ip, port): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('goatse.cx', 80)) s.listen(0) while 1: (incoming_socket, address) = s.accept() incoming_socket.send(b'HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<html><body><img src="http://goatse.cx/"></body></html>') incoming_socket.close()

Python
Guest
generate functionSun, 16 Jul 2023

almacenar 4 productos en un arreglo tridimensional las ventas mensuales de cada uno de ellos y el promedio de ventas durante los últimos 3 años.

#include<stdio.h> #include<stdlib.h> #include<windows.h> int main() { float producto[3][4][12],promedio[4][12]; int i,j,k; for(i=0;i<3;i++) { for(j=0;j<4;j++) { for(k=0;k<12;k++) { printf("Ingrese venta del producto %d, mes %d, año %d\n",i+1,j+1,k+1); scanf("%f",&producto[i][j][k]); } } } for(j=0;j<4;j++) { for(k=0;k<12;k++) { promedio[j][k]=0; for(i=0;i<3;i++) { promedio[j][k

C++
Guest
generate functionTue, 25 Apr 2023

El Banco Gerencial de Desarrollo BGD, quiere determinar cuánto pagará un cliente que tome un préstamo no mayor de 200,000.00 para pagarlo en 24 meses a una Tasa de Interés de 2% mensual. Se requiere saber el valor o monto total que pagará el cliente en 2 años entre capital e intereses.

def main() principal = 200000 monthly_interest_rate = 0.02 number_of_payments = 24 payment = principal * ((monthly_interest_rate * (1 + monthly_interest_rate)**number_of_payments) / ((1 + monthly_interest_rate)**number_of_payments - 1)) return payment

C#
Guest
generate functionTue, 02 May 2023

programa para hacer sucesiones de cuadrados en consola grafica

#include <math.h> #include <graphics.h> #include <iostream> using namespace std; int main() { int gd = DETECT, gm; initgraph(&gd, &gm, "C:\\TC\\BGI"); int x1, y1, x2, y2; x1 = 50; y1 = 50; int n; cout << "ingrese el numero de cuadrados:"; cin >> n; cout << "ingrese el lado del cuadrado"; cin >> x2; y2 = x2; for (int i = 1; i <= n; i++) { rectangle(x1, y1, x2, y2); x1 = x1 - 10; y1 = y1 - 10; x2 = x2 + 20; y2 = y2 + 20; } getch();

C++
Guest
generate functionSat, 26 Nov 2022

masonry layout grid vue js

import { Vue, Component, Prop, Watch } from "vue-property-decorator"; @Component({ name: "Masonry", }) export default class GridLayout extends Vue { @Prop({ default: false }) horizontal!: boolean; @Prop({ default: 200 }) gutter!: number; @Prop({ default: 0 }) column!: number; @Prop({ default: null }) minWidth!: number | null; @Prop({ default: null }) maxWidth!: number | null; @Prop({ default: null }) breakpoint!: number | null; @Prop({ default: true }) transition!: boolean; @Prop({ default: "fade" }) transitionMode!: string; @Prop({ default: 300 }) transitionDuration!: number; private $slots = this.$slots; private $props = this.$props; private currentWidth: number = 0; private currentGutterSize: number = 0; private transitionDurationStyle

TypeScript
Guest
generate functionFri, 05 May 2023

Create a Google Chrome extension that, upon activation, opens a new tab in the browser with its graphical interface. The interface should have the necessary options and filters to search for a keyword...

# -*- coding: utf-8 -*- # Copyright (c) 2019, DigiThinkIT and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class ProductDetector(Document): pass

Python
Guest
generate functionWed, 31 May 2023

funcion que ordene los elementos de una cola sin usar imports

public class Pila{ int [] pila = new int[10]; int cima = -1; public void push(int x){ cima++; pila[cima] = x; } public void pop(){ cima--; } public boolean empty(){ return cima == -1; } public int size(){ return cima+1; } public int top(){ return pila[cima]; } public void ordena(){ for( int i=0; i<pila.length; i++){ for( int j=i+1; j<pila.length; j++){ if(pila[j] < pila[i]){ int t = pila[i]; pila[i] = pila[j]; pila[j] = t; } } } } public void imp

Java
Guest
generate functionSat, 03 Dec 2022

void型の関数 histgram2() は、4つの引数をもち、順に [0,100] の範囲の値を要素にもつint型の配列変数 a[]、配列 a[] のサイズを表すint型の値 n、および、ヒストグラムの値を代入するためのint型の配列変数 h[]、ヒストグラムの区間の幅を表す int型の値 m である。 histgram2() は、与えられた配列変数 a[] の要素の値が、[0,m-1], [m...

void histgram2(int a[], int n, int h[], int m) { int i, j, k; i = 0; j = 0; k = 0; while (i < n) { if (m * k <= a[i] && a[i] < m * (k + 1)) { h[k]++; } else { k++; h[k]++; } i++; } }

C
Guest
generate functionWed, 24 May 2023

make a get API with response "Test"."Test" word should come from mysql DB and Admin portal should also be there which should be linked with DB to change the word and host on heroku or any Hosting site.

// This is a "stub" file. It's a little start on your solution. // It's not a complete solution though; you have to write some code. // Package greeting should have a package comment that summarizes what it's about. // https://golang.org/doc/effective_go.html#commentary package greeting // HelloWorld needs a comment documenting it as package does. func HelloWorld() string { return "Hello, World!" }

Javascript
Guest
generate functionTue, 15 Nov 2022

thread create another thread

#include <stdio.h> #include <pthread.h> void *thread_func(void *arg) { printf("New thread created\n"); return NULL; } int main() { pthread_t tid; pthread_create(&tid, NULL, thread_func, NULL); pthread_join(tid, NULL); return 0; }

C
Guest
generate functionTue, 21 Mar 2023

Add to this the code for generating a grid on the chart, as well as specifying the percentage difference directly on the chart bars plt.figure(figsize = (12, 4)) plt.bar(data.index, data['nutri'], co...

plt.figure(figsize = (12, 4)) plt.bar(data.index, data['nutri'], color = 'darkblue', label = 'nutri') plt.bar(data.index, data['mineral'], color = 'brown', label = 'mineral') plt.title('Comparison of Nutrient and Mineral Content') plt.xlabel('Nutrient|Mineral') plt.ylabel('Amount') plt.legend() plt.show()

Python
View User
generate functionWed, 31 May 2023

funcion que ordene los elementos de una cola sin usar imports

public class Pila{ int [] pila = new int[10]; int cima = -1; public void push(int x){ cima++; pila[cima] = x; } public void pop(){ cima--; } public boolean empty(){ return cima == -1; } public int size(){ return cima+1; } public int top(){ return pila[cima]; } public void ordena(){ for( int i=0; i<pila.length; i++){ for( int j=i+1; j<pila.length; j++){ if(pila[j] < pila[i]){ int t = pila[i]; pila[i] = pila[j]; pila[j] = t; } } } } public void imp

Java
Guest
generate functionSat, 06 May 2023

Login con conexión a MySQL con contraseña encriptada

import mysql.connector import hashlib import sys def login(username, password): """ """ # Create connection mydb = mysql.connector.connect( host="localhost", user="user", passwd="pass", database="mydatabase" ) # Create cursor to execute queries cursor = mydb.cursor() # Create query and execute query = f"SELECT * FROM login WHERE username = '{username}'" cursor.execute(query) # Fetch all results result = cursor.fetchall() # Check if query was successful if result == []: print("Invalid username and/or password") return # Check if user exists if len(result) != 1: print("ERROR: More than one user exists") return # Check if password is correct # Load password from database db_password = result[0][1] # Encrypt password

Python
Guest
ContactPrivacy Policyzigarettenautomatkarte.de