Answer to Question #159668 in C++ for zain ul abdeen

Question #159668

Write a program that reads two arrays from the user of the same size:

Lab_Marks: contains double numbers representing the students’ lab marks

Absences: contains integer numbers representing the total absences for each student.

Compute the Result (and save in another array of same size of double data type) by subtracting Absences from the corresponding element in Lab_Marks

Sample output is here:

Lab_Marks

78.0

90.0

55.5

85.7

99.0

Absences

5

3

2

0

3

Result

73.0

87.0

53.5

85.7

96.0


1
Expert's answer
2021-02-01T03:33:28-0500

#include<iostream>

using namespace std;



int main(){

double Lab_Marks[50];

int Absences[50];


for(int i=1;i<=50;++i){

cout<<"enter marks"<<endl;

cin>>Lab_Marks[i];



}

cout<<"lab marks"<<endl;

for( i=1;i<=50;++i){

cout<<"enter marks"<<endl;

cout<<Lab_Marks[i]<<endl;;



}


return 0;}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog