I am trying to create a multiplication table that is left aligned with a line under the header and a line next to the first column on the left. What I have here gives me what I want but without the lines. Can anyone help? 1. #include <iostream> 2..#include <iomanip> 3. using namespace std; 4. //program that computes a multiplication table, basic formatting or 5. int main() { 6. int i,j; 7. //first print out the header 8. cout << setw(5) << std::left << " "; 9. for(i=1; i<=10; i++) { 10. cout << setw(5) << i; 11. } 12. …

Member Avatar
Member Avatar
+0 forum 8

I am trying to write a program that will prompt the user for six grades to be entered (one at a time), read in each grade entered by the user, and store them in an array of six elements. Grades should be on a 0 to 4.0 (inclusive) scale, and the program should accept only grades within that range. I.e. whenever the user enters a grade less than 0 or greater than 4.0, the program will prompt the user to re-enter that grade within the correct range (and do so repeatedly, as long as he/she continues to enter an invalid …

Member Avatar
Member Avatar
+0 forum 13

Leap Years Def: A year is a century year if it is divisible by 100. Def: A year is a non-century year if it is not a century year. Def: A year is a leap year if it is a non-century year that is divisible by 4, or a century year that is divisible by 400. Nothing else is a leap year. In a source file named leapyears.cpp, write a program that will prompt the user for the starting year and ending year for a range of years and print to the screen all leap years in that range, 5 …

Member Avatar
Member Avatar
+0 forum 8

I need to create a decision tree that sorts any three integers in ascending order. This is what I did:[code=c] #include <iostream> using namespace std; int main() { int x, y, z; cout << "Enter three integers: "; cin >> x >> y >> z; cout << "Your three integers in ascending order are: "; if(x <= y){ if(x <= z) cout << x << " "; if(y <= z) cout << y << " " << z << endl; if(z <= y) cout << z << " " << y << endl; } else if(y <= x){ if(y <= …

Member Avatar
Member Avatar
+0 forum 3

The End.