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 functionSun, 04 Dec 2022

How to access WithdrawChecking() in LoginForm inside MainTransactionForm

//in MainTransactionForm.Xaml.cs public partial class MainTransactionForm : Form { public MainTransactionForm() { InitializeComponent(); } private void withdrawButton_Click(object sender, EventArgs e) { LoginForm loginForm = new LoginForm(); loginForm.WithdrawChecking(); } } //in LoginForm.Xaml.cs class LoginForm { public void WithdrawChecking() { if(true) { MessageBox.Show("withdraw checking"); } } }

C#
Guest
generate functionTue, 17 Jan 2023

Алгоритм шифрования и расшифровки штатной сигнализации Ford C-Max

// Список битов с сообщения // 1 бит - стартовый бит (1) // 2 - 8 бит - биты сообщения (7 бит) // 9 бит - бит паритета (должен быть равен чётности всех битов сообщения) // 10 бит - стоп-бит (0) char start_bit = 1; char message_bit_1 = 0; char message_bit_2 = 0; char message_bit_3 = 0; char message_bit_4 = 1; char message_bit_5 = 0; char message_bit_6

C++
Guest
generate functionSun, 05 Feb 2023

9. Разработайте приложение «7 чудес света», где каждое чудо будет представлено отдельным классом. Создайте дополнительный класс, содержащий точку входа. Распределите приложение по файлам проекта и с помощью пространства имён обеспечьте возможность взаимодействия классов.

using System; using Classes; namespace SevenWonders { class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); } } }

C#
Guest
generate functionWed, 02 Aug 2023

I want to make a panel with a text box and a button to execute and another to delete and another to copy from the clipboard

# public static Panel CreatePanel() { var panel = new Panel(); var textBox = new TextBox(); textBox.Location = new Point(10, 10); textBox.Size = new Size(200, 50); panel.Controls.Add(textBox); var button = new Button(); button.Location = new Point(10, 70); button.Size = new Size(200, 50); button.Text = "Execute"; panel.Controls.Add(button); return panel; } private void button1_Click(object sender, EventArgs e) { var panel = CreatePanel(); Controls.Add(panel); }

C
Guest
generate functionSat, 25 Mar 2023

Si en cualquier momento S1 es HIGH entonces salida1 y salida2 serán LOW (Activar salida1 y esperar 5 segundos si entrada1 es HIGH Activar salida2 y esperar 5 segundos si entrada2 es HIGH)

++ bool S1 = 0; bool S2 = 0; bool S3 = 0; bool S4 = 0; bool S5 = 0; bool S6 = 0; bool S7 = 0; bool S8 = 0; bool S9 = 0; bool S10 = 0; bool S11 = 0; bool S12 = 0; bool S13 = 0; bool S14 = 0; bool S15 = 0; bool S16 = 0; void setup() { pinMode(S1, OUTPUT); pinMode(S2, OUTPUT); pinMode(S3, OUTPUT); pinMode(S4, OUTPUT); pinMode(S5, OUTPUT); pinMode(S6, OUTPUT); pinMode(S7, OUTPUT); pinMode(S8, OUTPUT); pinMode(S9, OUTPUT); pinMode(S10, OUTPUT); pinMode(S11, OUTPUT); pinMode(S12

C
Guest
generate functionSun, 30 Apr 2023

Implementar una Calculadora de Números Enteros, mediante un proyecto de consola en C++, cuyo algoritmo permita: 1. Mostrar un menú de 6 opciones: • 1. Sumar dos números. • 2. Restar dos números. • 3. ...

#include <iostream> using namespace std; int menu(){ int option; cout << "1. Sumar dos numeros.\n"; cout << "2. Restar dos numeros.\n"; cout << "3. Multiplicar dos numeros.\n"; cout << "4. Dividir dos numeros.\n"; cout << "5. Número Primo?.\n"; cout << "6. Salir.\n"; cout << "Ingrese opción: "; cin >> option; return option; } int suma(int a, int b){ return a+b; } int resta(int a, int b){ return a-b; } int multiplicacion(int a, int b){ return a*b; } int division(int a, int b){ if (b == 0){ return 0; } return a/b; }

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 functionThu, 04 Apr 2024

área de un triangulo

lic double areaTriangle(double a, double b, double c) { return (a * b * Math.Sqrt(Math.Pow(c, 2) - Math.Pow(a, 2) - Math.Pow(b, 2))) / 2; } public double areaSquare(double a) { return a * a; } public double area

C#
Guest
generate functionSat, 01 Apr 2023

Make a dice class - The class should have a throw method that simulates throwing a die. It returns the number thrown, but it also stores in the instance how many we have thrown, whic...

function Dice() { this.value = 0; this.numberOfThrows = 0; this.renderTo = ""; } Dice.prototype.render = function () { document.querySelector(this.renderTo).innerHTML = this.value; }; Dice.prototype.throw = function () { this.numberOfThrows++; this.value = Math.ceil(Math.random() * 6); }; Dice.prototype.getNumberOfThrows = function () { return this.numberOfThrows; }; Dice.prototype.getValue = function () { return this.value; };

Javascript
Guest
generate functionFri, 05 Apr 2024

add 2 numbers and return them

You can use the following code to get the desired output. function add(a, b) { return a + b; } function subtract(a, b) { return a - b; } function multiply(a, b) { return a *

TypeScript
Guest
generate functionThu, 01 Jun 2023

(Lista simplemente enlazada) Se pide a Ud. realizar un aplicativo en java correspondiente a una lista simplemente enlazada, la cual ejecute las siguientes instrucciones: • Insertar al inicio de la lis...

// TODO code application logic here package Lista_Simplemente_Enlazadas; import java.util.Scanner; /** * * @author Juan Camilo */ public class Lista_Simplemente_Enlazadas { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Lista lista = new Lista(); int opcion = 0; int dato = 0; int posicion = 0; do { System.out.println("\nMENU"); System.out.println("1. Insertar al inicio de la lista"); System.out.println("2. Mostrar los elementos de la lista"); System.out.println("3. Insertar en la posición enésima"); System.out.println("4. Devolver la posición enésima de un elemento"); System.out.println("5. Ordenar los elementos de forma crecient

Java
Guest
generate functionWed, 03 May 2023

Elaborar un programa en Java que permita mostrar 3 catálogos de libros (novelas, ciencia, tecnología)

import java.util.Scanner; public class Ejercicio4 { public static void main(String[] args) { Scanner entrada = new Scanner(System.in); String[] novelas = { "El Alquimista", "Como agua para chocolate", "Cien años de soledad" }; String[] ciencia = { "La física de lo imposible", "El universo elegante", "La teoría del todo" }; String[] tecnologia = { "El futuro de la humanidad", "El viaje de la computadora", "La revolución de Bitcoin" }; System.out.println("Libros de Novelas"); System.out.println("================"); for (String i : novelas) { System.out.println(i); } System.out.println("Libros de Ciencia"); System.out.println("================"); for (String i : ciencia) { System.out.println(

Java
Guest
text to sql syntaxTue, 17 Jan 2023

Выгрузить все столбцы таблиц с описанием ВСЕХ типов полей по группам типов(например текст, JSONB, число, вещественное число) через case на русском языке. postgresql Выгрузить без пробелов и переносов. выгрузить одной строкой

SELECT string_agg(case data_type when 'character varying' then 'text' when 'integer' then 'integer' when 'double precision' then 'real' when 'jsonb' then 'jsonb' end,',') FROM information_schema.columns where table_schema='public' and table_name='customers';

generate functionThu, 29 Jun 2023

Realice una función int sumoveravg(int valores[ ], int n) que recibe como parámetro un arreglo de n elementos enteros y retorne la suma de los elementos que están por encima del promedio. Se conoce la función float avg(int nums[ ], int n), que retorna el promedio de los n números en 'nums'.

#include <stdio.h> float avg(int nums[ ], int n) { int i, sum = 0; for(i = 0; i < n; i++) { sum += nums[i]; } return ((float)sum)/n; } int main() { int nums[] = {1, 2, 3, 4, 5}; printf("%f", avg(nums, 5)); }

C
Guest
code to explanationMon, 14 Nov 2022

function checkValidOrderId(orderid, account, platid, outputObject) { if (typeof orderid !== 'string') { throw new Error('参数错误,orderid非法'); } //格式:代理编号 +yyyyMMddHHmmssSSS+ account if (account !=...

function checkValidOrderIdOnly(s) { let len = s.length; if (len !== 17) throw new Error('参数错误,orderid非法'); let v = parseInt(s); if (!Number.isFinite(v)) throw new Error('参数错误,orderid非法'); let d = new Date(v); if (d.getTime() !== v) throw new Error('参数错误,orderid非法'); let now = Date.now(); if (v > now || v < now - 24 * 60 * 60 * 1000) throw new Error('参数错误,orderid非法'); }

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
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 functionFri, 21 Apr 2023

標準入力から 2 つの整数を入力し、大きいほうの値を表示するプログラムを作成せよ。 (ヒント:2 つの変数を a、b とすると、a>b が「正しいとき」と「正しくないとき」でそれぞれどちらを表 示すればよいかが判断できるはずである。もし両者が同じ値のときは、a と b のどちらを表示してもよい)

a = input("a:") b = input("b:") if a > b: print(a) else: print(b)

Java
Guest
generate functionThu, 04 Apr 2024

área de un triangulo

lic double areaTriangle(double a, double b, double c) { return (a * b * Math.Sqrt(Math.Pow(c, 2) - Math.Pow(a, 2) - Math.Pow(b, 2))) / 2; } public double areaSquare(double a) { return a * a; } public double area

C#
Guest
generate functionWed, 12 Apr 2023

Realizar un script en Python que calcule las resistencias en paralelo o en serie, pidiendo primero la cantidad de resistencias, luego el tipo de conexión en formato string si es en “serie” o en “paral...

def serie(resistencias): total = 0 for resistencia in resistencias: total += resistencia return total def paralelo(resistencias): total = 0 for resistencia in resistencias: if resistencia == 0: return 0 total += 1 / resistencia return 1 / total def total(resistencias, tipo): if tipo == "serie": return serie(resistencias) elif tipo == "paralelo": return paralelo(resistencias) else: print("Tipo de resistencia no reconocida") return None resistencias = [] while True: cantidad = int(input("Ingrese la cantidad de resistencias: ")) if cantidad > 0: break print("Ingrese una cantidad positiva") for i in range(cantidad): while True:

Python
Guest
generate functionFri, 21 Apr 2023

標準入力から 2 つの整数を入力し、大きいほうの値を表示するプログラムを作成せよ。 (ヒント:2 つの変数を a、b とすると、a>b が「正しいとき」と「正しくないとき」でそれぞれどちらを表 示すればよいかが判断できるはずである。もし両者が同じ値のときは、a と b のどちらを表示してもよい)

a = input("a:") b = input("b:") if a > b: print(a) else: print(b)

Java
Guest
text to sql syntaxTue, 17 Jan 2023

Выгрузить все столбцы таблиц с описанием ВСЕХ типов полей по группам типов(например текст, JSONB, число, вещественное число) через case на русском языке. postgresql Выгрузить без пробелов и переносов. выгрузить одной строкой

SELECT string_agg(case data_type when 'character varying' then 'text' when 'integer' then 'integer' when 'double precision' then 'real' when 'jsonb' then 'jsonb' end,',') FROM information_schema.columns where table_schema='public' and table_name='customers';

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
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
ContactPrivacy Policyzigarettenautomatkarte.de