Assignment_4 - The function should cout the results . Use a...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Computer Science G175 – C++ Programming Assignment 4 Assignment_4.cpp (1 point) Write a complete program that takes a user input representing a number of minutes and converts this input into hours and minutes. A typical program run would look similar to the following: This program converts minutes to hours and minutes. Please enter a number of minutes (an integer) to be converted : 124 124 minutes equals 2 hours and 4 minutes. Use “cin” to store the user input in an integer variable. To perform the time conversion and display the result, create a function called convert_from_minutes(). convert_from_minutes() should take a single integer parameter, and should use the modulus (%) operator to perform the time conversion.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: The function should cout the results . Use a prototype and a separate implementation when coding the convert_from_minutes() function. Use the Conditional (Ternary) Operator to spell hour(s) and minute(s) properly. For instance if the result is 1, spell 1 minute (or 1 hour), and if the result is 4, then spell 4 minutes (or 4 hours) You'll get 1 point for this assignment and it is due Tuesday September 28 th . In addition to this lab, also review the Word document Session 4 that has been posted to the website. Please refer to our textbook, chapter Lesson 6 for additional information. Page 1 of 1...
View Full Document

This note was uploaded on 12/07/2010 for the course CS 175 taught by Professor Mike during the Spring '06 term at Golden West College.

Ask a homework question - tutors are online