C++ program that declares a structure to store the ID of the student and array of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
C++ program that declares a structure to store the ID of the student and array of student marks (5 marks). It defines the structure variable, input the values, and print the ID, marks, and the summation of marks : #include <iostream> using namespace std; struct student int id; double marks[5]; } int main () { student s; double sum=0; cout<<"enter id:"; cin>> s.id; for (int i=0; i<5;i++) { cout<<" enter mark "<<i; cin>> s.marks[i]; cout<<endl; cout<<"the id is : "<<s.id<<endl; for (int i=0; i<5;i++) { cout<<" the mark "<< s.marks[i]; sum= sum+ s.marks[i]; cout<<"the sum of marks is: "<<sum; return 0; Exercise: 1- Find the average of student marks in example1 2- Create array of students C++ program that declares a structure to store the ID of the student and array of student marks (5 marks). It defines the structure variable, input the values, and print the ID, marks, and the summation of marks : #include <iostream> using namespace std; struct student int id; double marks[5]; } int main () { student s; double sum=0; cout<<"enter id:"; cin>> s.id; for (int i=0; i<5;i++) { cout<<" enter mark "<<i; cin>> s.marks[i]; cout<<endl; cout<<"the id is : "<<s.id<<endl; for (int i=0; i<5;i++) { cout<<" the mark "<< s.marks[i]; sum= sum+ s.marks[i]; cout<<"the sum of marks is: "<<sum; return 0; Exercise: 1- Find the average of student marks in example1 2- Create array of students
Expert Answer:
Posted Date:
Students also viewed these programming questions
-
Write a short C program that declares and initializes (to any value you like) a char, an int, and a double. Next, declare and initialize a pointer to each of the three variables. Your program should...
-
Q3. Show the return value of main through register inspection Q4. Issue the following commands: (gdb) list swap_n_add (gdb) disas swap_n_add Group the assembly code instructions with their...
-
Using the STUDENT table structure shown in Table P6.4, do the following: a. Write the relational schema, draw its dependency diagram, and identify all dependencies, including all transitive...
-
In Exercises show that the two formulas are equivalent. tan x dx = - In cos x + C tan x dx = In|sec x] + C
-
Explain the skills and abilities required for event management.
-
Honest Truck Company is a large trucking company that operates throughout the United States. Honest Truck Company uses the units-of-production (UOP) method to depreciate its trucks. Honest Truck...
-
How can forward exchange contracts be used to manage foreign exchange risk?
-
The owner of a Major League Baseball team is considering moving his team from its current city in the upper Midwest to a city in the Southeast that offers a larger television market, a new stadium,...
-
15. A simple LR circuit is connected to a battery at t = 0. The time instant at which rate of energy storage in inductor is half of power delivered by battery (a) In 2 (c) In 2 (b) In () (d) In 3 16....
-
For the circuit of Figure P2.39, determine the transform of the output voltage V0(s). Assume that the circuit is in steady state when t Figure P2.39 Model of an electronic circuit. IF 2 H Ion 2 4
-
A company recently downsized its number of employees by 30%. If there are still 84 employees, how many employees were there prior to the layoffs?
-
A description of the issue(s) faced at Calabash? 2) Is DCF analysis relevant for a not-for-profit enterprise? You must explain your response to earn credit. 3) Is the 7% discount rate offered by...
-
Suppose the current exchange rates are 1.3215 dollars per euro, and 84.19 yen per dollar. What is the current exchange rate between yen and euros?
-
2005 Retained earnings: $ 2.000.000 Common stock: $ 500.000 Paid in capital: $ 3.000.000 Net income for year: $ 900,000 2004 Retained earnings: $ 1,300,000 Common stock: $ 500,000 Paid in capital: $...
-
A company is introducing a product that can sell at: 10 DOP per unit, it is estimated that the volume of sales to be made is 200,000 units the first year and for the following years an increase of 5%...
-
If the point on a wave takes a time of 0.033 s to go from the maximum displacement to the first equilibrium position, what is the frequency of the wave?
-
1-butanol yields 1-bromobutane in the presence of concentratedsulfuric acid and an excess of sodium bromide. CH 3 CH 2 CH 2 CH 2 OH (l) ?CH 3 CH 2 CH 2 CH 2 Br(l) If 13.55 mL of 1-butanolproduced...
-
Carlton Stokes owns and operates a car-detailing business named SuperShine & Detailing. For $150, Carltons business will hand wash and wax customers cars, vacuum the interior, and thoroughly clean...
-
An analyst is preparing a forecast of dividends for Hoshino Distributors for the next five years. He uses a spreadsheet model with the following assumptions: Sales are $100 million in Year 1. They...
-
The group \(\mathrm{D}_{3}\) in Schoenflies notation (32 in international notation, which is read "three-two"; see Table 5.1 ) consists of the proper (those not reflections or inversions) covering...
-
Derive the two-dimensional matrix representation Tic)=(2) Tin)=(3) Tex)=(37) (69) T(c2b)= 1 TO)-(71) 10-(11) TO=(9) = for the group D3, using the basis (e1, e2) defined in the following figure.
Study smarter with the SolutionInn App