#include #include using namespace std; int main() { //Quiz: Write a program that asks //user to enter a number, then counts up by 10's (starting at 0) //up to that number. Submit to blackboard by 12:40 //quiz is called quiz-9-8 in blackboard. //Example 1: //Enter a number: // 100 //Cool: 0 10 20 30 40 50 60 70 80 90 100 //Example 2: //Enter a number: // 37 //Cool: 0 10 20 30 cout << "Enter a number: " << endl; int num; cin >> num; for (int i = 0; i <= num; i = i + 10) { cout << i << " "; } //challenge 1: //display product of 1*2*3*4*...*10 //In other words, 10! int product = 1; for (int i = 1; i <= 10; i++) { product = product * i; } cout << "10 factorial is: " << product << endl; //challenge 2: Ask user to enter their name //in all lowercase letters. //Print name entered, but vertically cout << "Please enter name in all lowercase: " << endl; string name; cin >> name; cout << "Cool, here is your name, but vertically: " << endl; for (int i = 0; i < name.length(); i++) { cout << name[i] << endl; } //challenge 3: print name user entered, but backwards. cout << "Here is your name, but backwards: " << endl; for (int i = name.length(); i >= 0; i = i - 1) //i-- is same thing { cout << name[i]; } cout << endl; cout << endl; //challenge 4: //Print the name they entered, but in all capital letters. for (int i = 0; i < name.length(); i++) { name[i] = name[i] - 32; } cout << "Here is your name, but in all upper case: " << endl; cout << name << endl; return 0; }