Answer:
#include <iostream>
#include <cstdlib>
using namespace std;
int main(){
int sum=0, num=5; //variables declaration and inicialization
while (sum<500){ //conditioning to do the sum up to 500
sum=sum+num; //actually sum process
cout << "The value is: "<<sum; //show the result in screen
};
return 0;
}
Answer:
b.you can focus on otherthings
Answer:
JavaScript
Explanation:
JavaScript is one of the simplest programming languages which makes the page dynamic and user interactive. It is a command based programming language that is a part of DHTML (Dynamic hypertext markup language ). The dynamic web page can be modified and its values can be changed.
JavaScript allows users to enter the value and provide the result at the same time and very fast.
JavaScript can be used online or offline too.
JavaScript provided much functionality such as when a customer searches anything, it completes the search automatically.
Answer:
See Explaination
Explanation:
/ Header files section
#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
#include <cmath>
using namespace std;
// start main function
int main()
{
// variables declaration
string fileName;
string lastName;
double score;
double total;
double grade;
string description;
// prompt the user to enter the input file name
cout << "Enter the input file name: ";
cin >> fileName;
// open the input file
ifstream infile;
infile.open(fileName);
// exit from the program if the input file does not open
if (!infile)
{
cout << fileName << " file cannot be opened!" << endl;
exit(1);
}
// repeat the loop for all students in the file
infile >> lastName;
while (infile)
{
infile >> score;
infile >> total;
// compute the grade
grade = score / total * 100;
// find the grade's description
if (grade > 90)
description = "Excellent";
else if (grade > 80)
description = "Well Done";
else if (grade > 70)
description = "Good";
else if (grade >= 60)
description = "Need Improvement";
else
description = "Fail";
// display the result of each student
cout << lastName << " " << setprecision(0) << fixed << round(grade) << "% " << setprecision(5) << fixed << (grade * 0.01) << " " << description << endl;;
infile >> lastName;
}
// close the input file
infile.close();
system("pause");
return 0;
} // end of main function