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
X=10 ;
NNADVOKAT [17]

Answer:

The answer is x=10; y=15;

There is no change in the values of the variables x and y.

Explanation:

The integer variables x and y are initialized to 10 and 15 respectively as given.

x=10 ;

y=15 ;

The values of variables x and y are passed as parameters to another method, as shown.

mystery (x, y);

The mystery method given in the question is used to assign the same value to both the variables. The value of both the variables hold the value of x, i.e., both the variables hold the value of 10.

void Mystery ( int one , int two )  

{  

// temporary

int temp;  

// temp initialized to value of variable one which contains the value of variable x

// temp = x or temp = 10

temp = one;

// one is initialized to the value of itself or value of x

// one = x or one = 10

one = one ;

// temp is assigned value of variable x through variable one

// temp = 10

// y is also assigned value of temp variable

// y = 10

two = temp;  

}

As shown in the above steps, the mystery method is used to assign same values to variables one and two.

The values of original variables x and y are not affected since x and y are not utilized or called inside the mystery method.

This type of passing of parameters to a method can be described as passing a copy of the values of the parameters to the method.

Value of variable x is passed into variable one while value of variable y is passed into variable two.

Hence, values of variables one and two can be changed and modified without affecting the values of original variables x and y.

3 0
3 years ago
Cómo se hacían antes las cosas que hoy en día se hacen apoyadas en aplicaciones y software?
KatRina [158]

Answer:

Las cosas que hoy en día se hacen apoyadas en aplicaciones y el software se hacían de manera manual, artesanal o empírica, es decir, antes del avenimiento de la era digital, las tareas que hoy se han automatizado o informatizado se realizaban de forma analógica, mediante procesos con una participación humana mucho más fuerte.

Así, por ejemplo, en el entrenamiento, la medición de variables por parte de los entrenadores respecto de los atletas era procesada de forma manual: la comparación de las distintas estadísticas era recopilada en formato físico, y analizada en forma personal por profesionales idóneos para tal tarea, mientras que hoy en día esa tarea se ha automatizado y es llevada a cabo por programas informáticos específicos.

A su vez, respecto de la tecnología, por ejemplo, el análisis de las variables de mercado y la subida o bajada de distintos valores era sistemáticamente analizada en forma manual, mientras hoy en día diversos programas permiten realizar un análisis técnico y financiero en forma digital.

6 0
4 years ago
The effects of activating the complement system include all of the following except
Bezzdna [24]

Effect of Activating the complement system

Inhibition of the immune response is not an effect of Activating the complement system

Explanation:

The effects of activating the complement system include destruction of target cell plasma membranes and stimulation of inflammation.  Inhibition of the immune response is not an effect of activating the complement system. Opsonization and Chemotaxis are also known effect of activating the complement system. Opsonization is  an immune process where bacteria are targeted for destruction by an immune cell called as phagocyte . Chemotaxis is movement of the cells in response to a chemical stimulus. Chemotaxis is the cell movement toward a gradient of increasing chemical concentration

6 0
3 years ago
A dog walks 10 km north in 2 hours and then 8 km south in 1 hour.
OverLord2011 [107]

Answer:

Average speed = 6 km/h and Average velocity = 0.67 km/h

Explanation:

Given that,

A dog walks 10 km north in 2 hours and then 8 km south in 1 hour.

(a) Average speed = total distance traveled divided by total time taken

Distance = 10+8 = 18 km

Total time = 2+1 = 3 h

Average speed = (18/3 )km/h= 6 km/h

(b) Average velocity = net displacement divided by total time taken

Let north is positive and south is negative

Displacement = 10+(-8) = 2 km

Total time = 2+1 = 3 h

Average velocity= (2/3 )km/h= 0.67 km/h

3 0
3 years ago
BRAINLIEST 14 points
lana [24]

Answer:

the first four options

Explanation:

they make the most sense

8 0
3 years ago
Read 2 more answers
Other questions:
  • Technology that is attached to a tag and used to identify postal packages is a(n) _____.
    12·2 answers
  • Write a short java method that takes an integer n and returns the sum of all the odd positive integers less than or equal to n.
    5·1 answer
  • Which letter indicates the amplitude of the wave?<br> a. A<br> b. B<br> c. C<br> d. D
    12·1 answer
  • If you create and invoke a recursive function without accounting for a base case, what can go wrong?
    15·1 answer
  • A ___ is a node (or a device) that connects two different networks together and allows them to communicate.
    12·1 answer
  • Error: 404 Not Found <br>The resource that you requested does not exist on this server.
    14·2 answers
  • In filmmaking, who is ultimately responsible for the creative process?
    15·1 answer
  • Identify whether each of the following goals would be a short-term or long-term goal for a high school senior who will graduate
    12·2 answers
  • Working with do-while loop
    9·1 answer
  • What are web protocols.
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!