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
I only want someones opinion on this not anything you would find in a book.
Hoochie [10]
As a missile training device in the 80s to help train the anti missile defense personnel to take down nuclear missiles.
4 0
4 years ago
What is diffie-hellman most commonly used for?
Alex777 [14]
DH is an algorithm to derive a shared secret over an unsafe channel.

Both parties exchange public keys, and can join them together with their private keys to create the secret. An eavesdropper can see both public keys, but since he doesn't posess the private keys, cannot derive the same secret.

The secret can be used to subsequently encrypt communications with a symmetric algorithm.

TLS uses this approach.
6 0
3 years ago
During which phase of system development would you acquire any necessary hardware and software?
solmaris [256]

During the <u>design</u> phase of system development, you would acquire all the necessary hardware and software.

<h3>What is SDLC?</h3>

SDLC is an abbreviation for system development life cycle and it can be defined as a strategic methodology that defines the key steps, phases, or stages for the design, development and implementation of high quality systems.

In Computer technology, there are seven (7) phases involved in the development of a system and these include the following;

  • Planning
  • Analysis
  • Design
  • Development (coding)
  • Testing
  • Deployment
  • Maintenance

Also, phased implementation simply refers to an implementation methodology in which smaller portions of functionality of a system are typically implemented one at a time (one after the other).

In conclusion, we can infer and logically deduce that you would acquire all the necessary hardware and software during the <u>design</u> phase of system development.

Read more on phases here: brainly.com/question/7112675

#SPJ1

3 0
2 years ago
(Help please I don't know what to choose because it's both text and email but I can only pick one. HELP!!!!!!!!!!)
Brut [27]

Answer:

i think you would delete the emails

Explanation:

6 0
3 years ago
Read 2 more answers
The rules of right-of-way<br> Pedestrians, bicyclists, and skateboarders<br> when they use the road.
lorasvet [3.4K]

Whenever you are driving and you see a pedestrian, bicyclist, or skateboarder, they always have the right of way, no matter the scenario. Always give bikers 3-4 feet if possible between them and your vehicle when passing them, and always be careful around skateboarders.

I hope this helped you! Have a great day!

7 0
3 years ago
Other questions:
  • You created a database related to medicinal plants and their uses. For every plant, you would like to enter a description about
    11·1 answer
  • 5
    9·1 answer
  • Write a C++ function, lastLargestIndex that takes as parameters an int array and its size and returns the index of the last occu
    10·1 answer
  • which field in the contact form is used to control the order in which contacts are displayed in the current view
    15·1 answer
  • Does artificial intelligence have a place in our society why or why not
    5·2 answers
  • Need help ASAP??? Pick the best answers
    10·1 answer
  • What is the benefit of encapsulation?
    14·1 answer
  • Plz help
    5·1 answer
  • Which of the following statements describes the general idea of an assistive media​
    7·1 answer
  • Diferencias entre ciencia y tecnologia
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!