Write a program that asks the user to enter the number of Research projects done by 10 different students (Student 1, Student 2, ..., Student 10). Once the data has been entered the program must analyze the data and output the student who did the most Research projects
You'll be needing an array of integers to store for each student his corresponding number of Research projects.
Knowing that each student takes a place in the array, you can parse it first adding the corresponsind number of research projects, and on the way, you can keep in memory the student which did the most research projects.
So, you'll need to parse the array and enter the research project numbers, and you can, at the same time, keep in memory the position of the highest reserach project number, which will tell you the student who did them.
If I have understood clearly, your problem solution is :
using namespace std;
//input no of research projects
//done by 10 students
for(int i=0; i<sizeof(researchPro)/sizeof(researchPro); i++)
cout<<"Enter the number of research projects done by students : "<<flush;
cin >> researchPro[i];
int max = researchPro;
for(int j=0; j<sizeof(researchPro)/sizeof(researchPro); j++)
if(j > 0)
if(max < researchPro[j]) //if max is less than any number
max = researchPro[j]; //update it
cout<<"\nStudent with most research projects : " << max <<endl;
Re. What Stuugie said. We don't do peoples' homework for them. We will help once they make an honest attempt at it. Let's not help people cheat. Can you imagine what might happen if someone got through their degree courses that way, and then got a job in a safety-critical position? Can you spell "nuclear core meltdown", or "oh my god, that plane just fell out of the sky!"... ?
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.