Assignment 17 Due Tuesday, November 29 at 3:20pm on CatalystAssignment 17.1: Into the Void (10 pts)
* Name(s) * Section info */ #include<iostream> using namespace std; //write function prototypes and comments here int year; int day; int month; int hour; int minutes; string dayEve; cout << "Welcome! This program will print dates and times in both the American and European styles!\n\n"; cout <<"First, let's print a formatted date.\n\n"; cout << "Please enter the current year: "; cin >> year; cout << "Please enter the current month: "; cin >> month; cout << "Please enter the current day: "; cin >> day; cout << endl; //call to the formatDateAmerican function here //call to the formatDateEuropean function here cout << "\nNow, let's print a formatted time.\n\n"; cout << "Please enter the current hour: "; cin >> hour; cout << "Please enter the current minutes: "; cin >> minutes; cout << "Please enter whether it is \"morning\" or \"evening\": "; cin >> dayEve; cout << endl; //call to the formatTimeAmerican function here //call to the formatTimeEuropean function here cout << "\nBye! See you another day!" << endl; return 0; } //write functions here
formatDateAmerican takes as input three integer parameter, one for the year, one for the month and one for the day prints a formatted version of the date to the console, using the format m/d/yyyy returns nothing formatDateEuropean takes as input three integer parameters, one for the year, one for the month and one for the day prints a formatted version of the date to the console, using the format d.m.yyyy returns nothing formatTimeAmerican takes
as input two integer parameters, one for the hour, one for the minutes,
and a string parameter that contains either "morning" or "evening" prints a formatted version of the time to the console, using the format H:MMam or H:MMpm returns nothing formatTimeEuropean takes
as input two integer parameters, one for the hour, one for the minutes,
and a string parameter that contains either "morning" or "evening" prints a formatted version of the time to the console, using the 24 hour clock. Note that there is no am or pm in this format. returns nothing
Your output should look identical the output below when you are finished: Assignment 17.2: Squares, Triangles, Rectangles (10pts)
//Alter the code below to print rectangles by removing size and replacing it with length and width. for (int row = 1; row <= size; row++)
{
for (int col = 1; col <= size; col++)
{
System.out.print("*");
}
System.out.println();
}
int length; int width; int base; String shape; string repeat;
I will print squares for you! Rectangles and triangles, too!
Enter the shape that you would like to print (rectangle, triangle or square): _
Enter the length of the rectangle: _ Enter the width of the rectangle: _
You entered an invalid shape!
Would you like me to print more shapes for you (y/n)? _
Thanks for "square" dancing with me!
The output of your program should look identical to the output below: |