49,761 Topics
| |
Can Someone help me to convert my Python Code to Java Code please? My Python Code : def import_file(file): with open(file,"r") as f: lines = f.readlines() sline = [] for line in lines: xline=line.split(" ") sline.append(xline) return sline def set_file(idf,q,sline): for i in sline: if idf in i: sline[sline.index(i)][1] = … | |
Hello. There are two programs. One creates and transfers the file into memory, the other reads it. The problem is that reading happens every other time. That is, the data, then no. Where is the mistake? Where to look? ![с++.jpg](https://static.daniweb.com/attachments/4/da8ffa8aa779029ea918edd53ea959b5.jpg) | |
Nice to meet all who read my welcome thread! | |
I have to create a program that asks a person to enter a 2 digit number (10-99) and convert it into words. I've been working on this for days and I still don't see what I'm doing wrong! PLEASE HELP ME!!! EXAMPLE: 27 twenty-seven [CODE]#include <iostream> using namespace std; int … | |
Hi can you help me to fix the error in Invoice class .h - " dt Unknown override specifier" Date .h #include "Stock.h" #include "Invoice.h" #include <ostream> #include <iostream> class Date { int month, day, year; public: Date(); Date(int _month, int _day, int _year); Date& setMonth(int _month); Date& setDay(int _day); … | |
Binary search tree array implementation C++ The programmers can quickly implement a binary search tree because it has an extremely organized structure and has lesser complexity. Moreover, the users can perform the following operations using BST: Searching Insertion Deletion Traversal | |
Direction: create a program to computer for the final grade using scanner and JOptionpane. Given: Quiz- 20% Activity-60% Exam-20% Output Enter guiz grade: Enter activity grade: Enter exam grade: The final grade of: (Student name) si: (total of quiz, activity,and exam grade | |
Hello, i started to learn coding if you call it for c++ (windows forms). I created a button with a Fixed Text and a Button to Copy the text. What i need now is a "Add" button that adds alot of desired numbers and shows them in a second TextBox. … | |
[CODE]#include <iostream> using namespace std; int main() { int a,b,c, ope; cout<<"enter a value" << endl; cin >> a; cout<<"enter b value" <<endl; cin >> b; cout<<"enter operation (+ - * / and %)"; cin>> ope; if (ope == +) { c=a+b; cout<< c; break; } if (ope == -) … | |
A University wants to make a basic graphical display to show how many people received different grades for a piece of work on a module (histogram). You are required to write a program in C++ that achieves this. The program consists of the following three tasks: Task1 The program should … | |
#include <iostream> // input and output code #include<conio.h> // getch - passwd #include<cstdio> // fileopen fscanf fileclose #include<windows.h> // system cls and pause using namespace std; ///////////////////////////////////////////////////CLASS EMPLOYEE ///////////////////////////////////////////////////////// class admin{ private:// variables for admin details char name[30],id[5],position[20]; int age,Salary,experience; //quit functions void quit(void){ cout<<"\n\n\n Please ENTER To Go Back … | |
How to add score counter to rock paper scissors game? I can't get score counter work. (Player wins, Computerwins) I got it working without functions but now when I added them I don't just get it how to do it... #include <iostream> #include <math.h> #include <string> int numGen (); int … | |
**i really need your help guys for data structure and algorithm task my assignment is menu-driven program for array operations in c++ Traversal, Insertion, Deletion, Searching, Sorting i have to perform this in menu to show how they work can you please provide mee code for this** | |
**i need help please help mee i got data structure task ** | |
| |
#include "iostream" #include "iomanip" #include "cmath" #include "string" using namespace std; int main() int temp[7][2]= {0}; int day = 0; for(int i = 0; i < 7; i++) { cout<<endl<<" Day: "; cin >> day; for(int i = 0; i < 7; i++) { cout << "\nEnter low temperature: "; … | |
Hi all, I've started to dive into OpenGL w/C++ to expand my library knowledge but I had a few questions. I've been following a tutorial online that basically walks step by step through the compiler linking, functions, and basics of an OpenGL program. I really would love to create some … | |
task 123454321 123454321 123454321 123454321 123454321 #include<iostream> using namespace std; int main(){ int i,j; for (i=1; i<=5; i++) cout<<i; for(j=4; j>=1; j--) cout<<j; } But what the next ??? | |
1. Write a program that would print the information (name, year of joining, salary, address) of employees by creating a class named 'Employee'. 2. Create a function in the Employee class that finds an employee by the given year of joining. 3. Create a function for sorting the employees according … | |
Write a C or C++ program that outputs prime numbers. This program should work as follows: The user will run the program and will enter a number on the command line. The program will then create another process using fork() that outputs all the prime numbers less than or equal … | |
The arithmetic mean of two numbers is the result of dividing their sum by 2. The geometric mean of two numbers is the square root of their product. The harmonic mean of two numbers is the arithmetic mean of their reciprocals. Write a C++ program that asks the user for … | |
i have code for write on console and change the text color and backcolor and clear screen(and much more) inside of a nice class console. these function change the text color and back color: void SetColorAndBackground(int ForgC, int BackC=0) { SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), ForgC|(BackC<<4) ); } but is there any way for … | |
how to write a function of image rotation by using the following f is the input image, (x0,y0) is the rotating center & a is the rotating angle. Return value is the output image (using IM & Bilinear interpolation); | |
how to rotate image using c-- following this byte[,] rotation(byte[,]f, float x0,float y0,float a); f is the input image, (x0,y0) is the rotating center & a is the rotating angle. Return value is the output image (using IM & Bilinear interpolation); | |
print("Enter number of columns:",end=" ") cols=int(input()) print(cols) print("Enter number of rows:",end=" ") rows=int(input()) print(rows) print("") side="right"0 print("[5][5] is cleaned") for i in range(rows): if side=="left": for j in range(1,cols): print("Move forward") print("[{i}][{j}] is cleaned".format(i=i,j=j)) else: for j in range(cols-2,-1,-1): print("Move forward") print("[{i}][{j}] is cleaned".format(i=i,j=j)) if(i!=rows-1): if side=="left": print("Turn right") print("[{i}][{j}] … | |
![Screenshot_2021-10-02_134648.png](https://static.daniweb.com/attachments/4/fa8e4c345dd089410fa7414ea44ac516.png) | |
Hi pals, I am a Newbie in C++ Programming field. I plan to add graphics.h header class in Dev -C++ Version 4.9.9.2 from Bloodshed which is come along with Borland Compiler. I follow the Steps in URL : [url]http://www.uniqueness-template.com/devcpp/#step2[/url] But I Got Error in the Sample code which test the … | |
#include <iostream> #include <cstdlib> #include <time.h> using namespace std; int main() { srand(static_cast<int>(time(0))); int secret = rand() % 10 + 1; int guess; cout << "Guess a number between 1 and 10." << endl; cin >> guess while (guess != secret) { if (guess < secret) { cout << "Too … | |
Hello everyone I am a c++ beginner programmer, currently doing finalising classes. I wish to be assisted in fixing my code. I want to pass an array of objects as an argument and then use that object to search for data in the program but it seems like the objects … | |
#include <iostream> using namespace std; int main() { int a, b; char c, d; cin >> a >> b >> c >> d; for (int row = 1; row <= a; row++ ){ cout << c; for (int cols = 1; cols <= b; cols++){ cout << d; } } … |
The End.