#include <iostream>
using namespace std;
int main ()
{
}
Write a program that converts a numeric score (provided by the user) into a letter grade (A, B, C, D, or F).
The point-to-letter conversion rules are as follows:
score >= 90: A
score >= 80 (but less than 90): B
score >= 70 (but less than 80): C
score >= 60 (but less than 70): D
otherwise: F
The completed program should produce console content as follows:
Enter your score: [user-specified number] [user-specified number] converts to: [corresponding letter grade]
For example, on input of 84.7, execution of the program should result in the following console content:
Enter your score: 84.7 84.7 converts to: B
code:
#include<iostream>
using namespace std;
int main(){
double score;
cout<<"Enter your score:";
cin>>score;
if(score>=90){
cout<<score<<" converts
to: A";
}
else if(score>=80 && score<90){
cout<<score<<" converts
to: B";
}
else if(score>=70 && score<80){
cout<<score<<" converts
to: C";
}
else if(score>=60 && score<70){
cout<<score<<" converts
to: D";
}
else{
cout<<score<<" converts
to: F";
}
return 0;
}
--------------------------------------------------------------------------------------------------------------------------------
code with proper indentation

output:


#include <iostream> using namespace std; int main () { } Write a program that converts a...
#include <iostream> using namespace std; int main() {} Write a program that produces a line comprised of n alternating a's and b's, where n is user-specified. For example, the console content following a run of the completed program with an input of "5" is as follows: Enter a number: 5 A line of length 5: ababa
#include <iostream> using namespace std; int main() { } Write a program that, given a user-specified integer, prints out the next 10 integers (in increasing order; each on its own line). For example, given an input of 3, the console content following a run of the completed program will look as follows: Enter a number: 3 4 5 6 7 8 9 10 11 12 13
#include <iostream> using namespace std; int main() { } Write a program that solicits a user-specified amount of numbers and their values, and then computes the average value, as well as their parity (how many even versus odd). Below is the console content of an example run of the completed program. How many numbers would you like to store? 8 Enter the 8 numbers: 0 7 3 1 5 6 2 3 Average value: 3.125 Parities: 3 even, 5 odd
#include <iostream> using namespace std; void drawTriangle(int w) {} int main() {} Complete the program so that it produces a centered, isosceles triangle of a user-specified width. For example: Enter a width: 5 Result: ***** *** *
#include <iostream> using namespace std; void drawTriangle(int x) {} int main() {} Complete the program so that it produces a right-angle triangle of a user-specified height. For example: Enter a height for the triangle: 5 Result: * ** *** **** *****
#include <iostream> using namespace std; void drawRect(int h, int w) {} int main() {} Write a program that produces h x w rectangles comprised of alternating columns of 1's and 0's (where h and w all user-specified). For example: Enter the desired dimensions for a rectangle: 6 4 Result: 1010 1010 1010 1010 1010 1010
Write the missing statements for the following program. #include <iostream> using namespace std; int main(void) { int Num1; cout << "Enter 2 numbers: "; cin >> Num2; if (Num1 < Num2) cout << "Smallest number is " << Num1; else cout << "Smallest number is " << Num2; return 0; }
Write following program using Switch statement. #include <iostream> using namespace std; int main() int number; cout << "Enter an integer cin >> number; if (number > B) cout << You entered a positive integer: " << number << endl; else if (number (8) cout<<"You entered a negative integer: " << number << endl; cout << "You entered e." << endl; cout << "This line is always printed." return 0;
#include<iostream> #include<cstdlib> using namespace std; int main() { // create array of size 20 int arr[20]; int i; cout<<"scores : "; for( i = 0 ; i < 20 ; i++ ) { // generate a random number i range 70 - 100 an add it to arr arr[i] = rand() % 31 + 70; cout<<arr[i]<<" "; } // store the total score int total = 0;...
#include <iostream> using namespace std; int main() { int sumOdd = 0; // For accumulating odd numbers, init to 0 int sumEven = 0; // For accumulating even numbers, init to 0 int upperbound; // Sum from 1 to this upperbound // Prompt user for an upperbound cout << "Enter the upperbound: "; cin >> upperbound; // Use a loop to repeatedly add 1, 2, 3,..., up to upperbound int number =...