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
Can someone help me so I don’t fail this class:(
charle [14.2K]

Answer:

Whatcha need help with?

Explanation:

4 0
3 years ago
A technician receives an invalid certificate error when visiting a website with port 443 enabled. Other computers on the same LA
amm1812

Answer:

Option (A) is the right answer.

Explanation:

According to the scenario, the user system is giving the error of invalid certificate while other users on the same network do not report any error, which means that there is some problem in a particular system.

Date and time can also be one of the main cause of this error because wrong date and time creates problem in surfing many websites by giving certificate error.

Hence the most appropriate answer is option (A).

While other option are wrong because of the following reasons:

  • UEFI boot mode is mainly used in booting the operating system and has no connection with network.
  • Logon time is also wrong because if the problem is with the login server, it can not give certificate error.
  • User access control is also not correct because it is used to control the access of the user.
7 0
3 years ago
Compared with traditional methods, the entire rapid application development (RAD) process is expanded and, as a result, the new
tensa zangetsu [6.8K]

Answer:

<u>False</u>

Explanation:

Note, the Rapid Application Development (RAD) software development approaches are noteworthy not for its expanded design details but for <u>its simplicity of the software development process.</u>

In other words, the RAD approaches while taking user preferences into the software development process, focuses on making the software design process more flexible, such as by employing the use of prototypes, and less unnecessary details.

5 0
2 years ago
How to use github to creat a blog?Thank you
stepan [7]
You can use GitHub Pages! They have tutorials on their site to help you set up using that (too much for this format!). You can use it to make your own personal site, as well as host any existing site you may have.
5 0
3 years ago
Meats ages hair and feathers all contain this monomer
OverLord2011 [107]

Answer:Amino Acid

Explanation:

All proteins have amino acids

7 0
3 years ago
Other questions:
  • Plane eyes I don't know
    9·1 answer
  • When you purchase software in a box, reading the ________ is important to know if the software will function properly?
    13·1 answer
  • Claudia has a bachelors degree in computer information systems and she has learned to use some popular software testing tolls wh
    13·2 answers
  • Suppose the file is sent continuously as one big message. how long does it take to send the file, assuming it is sent continuous
    15·1 answer
  • To what type of user does he most likely have access? Jae is using a computer at the public library to do research she's able to
    9·1 answer
  • Microsoft Windows is the least used operating system. TRUE or FALSE.
    13·1 answer
  • John is runnig his Database application on a single server with 24 Gigabytes of memory and 4 processors. The system is running s
    6·1 answer
  • Which operating system user interface does not reside on the computer but rather in the cloud on a web server?
    5·1 answer
  • Select three advantages of cloud computing.
    10·1 answer
  • What's the difference between joystick and mouse​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!