49,761 Topics

Member Avatar for
Member Avatar for eliasarximan

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] = …

Member Avatar for Srinu@231
0
291
Member Avatar for kevinvholloman

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)

Member Avatar for rproffitt
0
52
Member Avatar for jamesfilipson
Member Avatar for adoleh

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 …

Member Avatar for emsmary
0
16K
Member Avatar for LDSFSD

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); …

0
135
Member Avatar for usman9266

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

-1
34
Member Avatar for Iskodaraog

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

Member Avatar for Kazalwadi
0
66
Member Avatar for Edin_2

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. …

Member Avatar for rproffitt
0
84
Member Avatar for Srinivas0

[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 == -) …

Member Avatar for Hamza_53
2
46K
Member Avatar for TomTom2525

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 …

Member Avatar for rproffitt
0
58
Member Avatar for Vinc_1

#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 …

Member Avatar for rproffitt
0
45
Member Avatar for Thedoce

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 …

Member Avatar for chuckgr
0
2K
Member Avatar for Mahinder_1

**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**

Member Avatar for rproffitt
0
413
Member Avatar for Mahinder_1
Member Avatar for Quinton_1
Member Avatar for Colton

#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: "; …

Member Avatar for Reverend Jim
0
28
Member Avatar for Dmiller071

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 …

Member Avatar for oussama_5
0
227
Member Avatar for melll

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 ???

Member Avatar for dbfud1988
0
62
Member Avatar for MohdAleeRehman

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 …

Member Avatar for Schol-R-LEA
0
79
Member Avatar for Hamza_52

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 …

Member Avatar for Reverend Jim
0
212
Member Avatar for Mohammed_98

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 …

Member Avatar for toneewa
0
204
Member Avatar for cambalinho

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 …

Member Avatar for Mendoza,
1
4K
Member Avatar for omar90

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);

Member Avatar for rproffitt
0
77
Member Avatar for omar90

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);

Member Avatar for rproffitt
0
98
Member Avatar for Essam_6

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}] …

Member Avatar for rproffitt
0
45
Member Avatar for Ashton21

![Screenshot_2021-10-02_134648.png](https://static.daniweb.com/attachments/4/fa8e4c345dd089410fa7414ea44ac516.png)

Member Avatar for rproffitt
-1
59
Member Avatar for logicslab

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 …

Member Avatar for James_163
2
27K
Member Avatar for Ashton21

#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 …

Member Avatar for rproffitt
0
39
Member Avatar for Bonga_1

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 …

Member Avatar for rproffitt
0
31
Member Avatar for Jinhwan

#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; } } …

Member Avatar for rproffitt
0
75

The End.