1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
skad [1K]
3 years ago
9

Write a C++ program that reads students' names followed by their test scores. The program should output each students' name foll

owed by the test scores and relevant grade. It should also find and print the highest test score and the name of the students having the highest test score. Student data should be stores in a struct variable of type studentType, which has four components: studentFName and studentLname of type string, testScore of type int (testScore is between 0 and 100), and and grade of type char. Suppose that the class has 20 students. Use an array of 20 components of type studentType.
Your Program must contain at least the following functions:
a. A function to read the students' data into the array.
b. A function to assign the relevant grade to each student.
c. A function to find the highest test score.
d. A function to print the names of the students having the highest test score.
Computers and Technology
1 answer:
Mashutka [201]3 years ago
6 0

Answer:

#include<iostream>

#include<conio.h>

using namespace std;

struct studentdata{

char Fname[50];

char Lname[50];

int marks;

char grade;

};

main()

{

studentdata s[20];

for (int i=0; i<20;i++)

   {

cout<<"\nenter the First name of student";

cin>>s[i].Fname;

cout<<"\nenter the Last name of student";

cin>>s[i].Lname;

cout<<"\nenter the marks of student";

cin>>s[i].marks;

}  

 

for (int j=0;j<20;j++)

{

if (s[j].marks>90)

{

 s[j].grade ='A';

}

else if (s[j].marks>75 && s[j].marks<90)

{

   s[j].grade ='B';

}

else if (s[j].marks>60 && s[j].marks<75)

{

 s[j].grade ='C';

}

else

{

 s[j].grade ='F';

}

}

int highest=0;

int z=0;

for (int k=0;k<20; k++)  

{

if (highest<s[k].marks)

{

 highest = s[k].marks;

 z=k;

}

 

}

cout<<"\nStudents having highest marks"<<endl;

 

cout<<"Student Name"<< s[z].Fname<<s[z].Lname<<endl;

cout<<"Marks"<<s[z].marks<<endl;

cout<<"Grade"<<s[z].grade;

getch();  

}

Explanation:

This program is used to enter the information of 20 students that includes, their first name, last name and marks obtained out of 100.

The program will compute the grades of the students that may be A,B, C, and F. If marks are greater than 90, grade is A, If marks are greater than 75 and less than 90, grade is B. For Mark from 60 to 75 the grade is C and below 60 grade is F.

The program will further found the highest marks and than display the First name, last name, marks and grade of student who have highest marks.

You might be interested in
A government agency is getting rid of older workstations. The agency will donate these workstations, along with other excess com
Basile [38]

Answer:

The answer is "Using the DoD 5220.22-M method and  Degauss media with a magnet".

Explanation:

The "DoD Standard" is a term used during the data sanitizing industry and refers to DoD 5220.22-M. The simplest ways are being used to help eliminate the previously stored data, by deleting hard disc storage facilities with the same data wherever that used a sequence of all zeros.

The sparging eliminates statistics to entirely delete the gravitational flux from electronic media. Hard drives as well as other data storage devices, for example, computer tapes, retain magnetic data. It could no longer be seen as storage after a disk is degaussed.

6 0
3 years ago
__________ locks can be changed after they are put in service, allowing for combination or key changes without a locksmith and e
Vladimir79 [104]

Answer:

Programmable.

Explanation:

Programmable locks can be changed after they are put in service, allowing for combination or key changes without a locksmith and even allowing the owner to change to another access method (key or combination) to upgrade security. This type of lock are operated using a programmable plastic card and are typically smart.

5 0
3 years ago
When backing up a database server to LTO tape drives, the following schedule is used. Backups take one hour to complete.
AleksandrR [38]

Answer:

C. 3

Explanation:

Linear Tape Open LTO tape drives are magnetic tapes used to store data. This can be used with small and large computers for backup purposes. The backup needs to maintained frequently so that new data is backup on every interval. The is a RAID failure on database server to ensure complete backup there must be 3  backup tapes needed.

4 0
3 years ago
How many pictures can a 32 mb memory card hold?
nasty-shy [4]
This depends on the number of pixels are in each picture. hope this helps.
7 0
3 years ago
Having knowledge of the main parts of a computer: CPU, ALU, INPUT, OUTPUT ,and MEMORY Can you explain in simple for dummies what
Morgarella [4.7K]

Answer:

Explanation:

Great question, it is important to ask these questions in order to get rid of any doubts you may be having.

I will explain this as simply as possible in separate parts.

CPU: the CPU is the brain of the computer where all the information is received, processed, and sent from.

ALU: are the digital circuits inside the CPU used to perform all the arithmetic and logic operations

INPUT: are the commands given to the computer by the user.

OUTPUT: is the information displayed on the screen by the computer.

Memory: is the piece of hardware used to save all the information that is currently being used by the computer.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

5 0
3 years ago
Other questions:
  • Mobile devices typically come pre installed with standard apps like web browsers , media players, and mapping programs true or f
    9·1 answer
  • A type TW cable containing two No. 12 copper conductors has a maximum overcurrent protection of
    7·2 answers
  • Websites whose URL’s contain tildes (~) are usually published by the government. TRUE or FALSE.
    8·2 answers
  • Compared to a virtual image, a real image
    15·2 answers
  • Rob used Track Changes to suggest changes in Jack's document. Jack agrees with some edits and disagrees with others. What should
    14·1 answer
  • A device is sending out data at the rate of 1000 bps. How long does it take to send
    12·1 answer
  • What is output?
    10·1 answer
  • How can you insert an image file in your word document?​
    12·1 answer
  • Pls help :( I am a radio and audio production student. What are two examples of a complex wave?
    10·1 answer
  • Help please i will give Brainliest
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!