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 "<
#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
Get step-by-step solutions from verified subject matter experts
