Musings, Courses, & Projects by Rob Marano

CS 102 Section C - Fall 2021 - Assignment 1

Instructions

Due by Friday, October 15, 2021 11:59:59pm ET

Do not forget to issue command at the top-level of your local GitHub repo:

cd ~/myHome/dev/{Last Name}_{First Name}_cs102_section_c_fall_2021_HOMEWORKS
git fetch origin
git checkout -b HW2
mkdir HW2
cd HW2
mkdir 1
mkdir 2
mkdir 3
mkdir 4
mkdir 5

Include a Makefile, and use it to build and run the program. Write your answers for each problem in its own directory. You can use the Makefile provided for you here

1 - (1 pt) Write a program that prints the perimeter of a rectangle given its height and width. Ask the user to input the two dimensions. Do you remember the formula for perimeter of a rectangle?

2 - (1 pt) Write a program to ask a user for an integer as the number of minutes, and outputs the total hours and minutes (110 minutes = 1 hour 50 minutes).

3 - (1 pt) Write a program that deliberately makes the following mistakes: (a) print a floating-point number using the %d conversion; (b) print an integer using the %f conversion; (c) print a character using the %d conversion.

4 - (2 pts) Given an amount of US money in cents, compute the number of quarters, dimes, nickels, and pennies needed to minimize the number of coins.