Question: convert following coding into algorithm number 1: #include using namespace std; int main() { // this variable is used to store mark entered by user

convert following coding into algorithm

number 1:

#include

using namespace std;

int main() { // this variable is used to store mark entered by user double mark; // getting mark from user cout << "Please enter your score: "; cin >> mark; // check if mark is greater than 50 and if so, // print the appropriate message, // otherwise calculate percentage and display corresponding grade. if(mark > 50){ cout << "Score is greater than 50."; }else{ // calculating percentage double percentage = (mark / 50) * 100; // print percentage cout <<"You have passed with "<= 0 && percentage < 60){ cout << "F."; }else if(percentage >= 60 && percentage < 70){ cout << "D."; }else if(percentage >= 70 && percentage < 80){ cout << "C."; }else if(percentage >= 80 && percentage < 90){ cout << "B."; }else if(percentage >= 90 && percentage <= 100){ cout << "A."; } } return 0; } number 2:

#include

using namespace std;

int main() { float petrol,miltrav,gal; cout<< "Please enter the number of litres of petrol consumed: "; cin >> petrol; cout<<"Please enter the number of miles travelled: "; cin >> miltrav; cout<<"Petrol consumed: " << petrol <

return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!