A program that will prompt the user for a date and a time

Assignment Help Basic Computer Science
Reference no: EM13861095

It's to be written in C++. You will be writing a program that will prompt the user for a date and a time. For the date, the user will be asked to enter in three integers (month, day, year). There will be four functions related to the date:

1.string getMonth() - Prompts the user for an integer resembling the month.

The function should then check the integer value and return the string

correlated to the month.

2.int getDay() - Prompts the user for an integer resembling the day and returns

the integer.

3.int getYear() - Prompts the user for an integer resembling the year and returns

the integer.

4.void displayDate(string month, int day, int year) - Displays the date in this

format: October 18, 2012

Next, the user will be asked to enter the time, which is to be then converted from military time and displayed. There will be three functions related to the time:

int getHours() - Prompts the user for an integer resembling the hour of the day in military time. If the user enters 23, the function should return 11. If the military time entered is >=12, set the global boolean variable PM to be true, else false. int getMinutes() - Prompts the user for an integer resembling the minutes and returns that integer. void displayTime(int hour, int min) - This function will check if the global boolean variable PM is true. If it is true, display the time in this format: 12:34 PM. If PM is false, display the time as so: 11:34 AM

For each "get" function, there should be an input-validation loop. The purpose for this lab is to allow you to become more comfortable with declaring functions, calling functions, and defining functions.

The output should be similar to the following:

Please enter in the month: 10

Please enter the day of the month: 18

Please enter the year: 2012

Please enter the hour in military format: 23

Please enter the number of minutes: 34

Reference no: EM13861095

Questions Cloud

What is the formula for finding omitted : What is the formula for finding omitted variable bias with multiple regressors?
Deacon publishing house is a publishing company : Deacon Publishing House is a publishing company that produces consumer magazines. The house and home division which sells home improvement and home decorating magazines, has seen a 20% reduction in operating income over the past nine months, primaril..
Describe the difference between classes and objects : Please describe the difference between classes and objects. How are they related? What does it mean to instantiate an object? Also, please describe the difference between composition and aggregation and when it is better to use one over the other?
Prompts the user for a hexadecimal digit : Write a MIPS program that prompts the user for a hexadecimal digit and then displays the decimal equivalent multiplied by 2. For example, the program displays 10 for hex '5', 20 for 'A', etc. If the user enters an invalid value, the program should di..
A program that will prompt the user for a date and a time : It's to be written in C++. You will be writing a program that will prompt the user for a date and a time. For the date, the user will be asked to enter in three integers (month, day, year). There will be four functions related to the date:
Sample the dribbling to extract its frequency : Consider a basketball being dribbled. If the height of the basketball can be described by a sine wave of maximum height 2h, average height h and minimum height 0, and the ball hits the ground once per second, how fast would a video camera have to sam..
What are your thoughts about your results : What are your thoughts about your results?  What are you feelings towards this assignment?  How would you improve it? Submit this with your assignment.
Know how to process command line arguments : Through this programming assignment, the students will learn to do the following: Know how to process command line arguments. Perform basic file I/O.
Theater seating revenue with input validation : Theater Seating Revenue with Input Validation: A dramatic theater has three seating sections, and it charges the following prices for tickets in each section:  Section A seats cost $20 each

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Consider a router that interconnects three subnets

Consider a router that interconnects three subnets

  Examine the invention and growth of crowdsourcing

Crowdsourcing in the field of interface design takes tasks traditionally performed by specific individuals and spreads them out among a group of people or a community. These assignments are usually done through an open call.

  What are the benefits of using tangible interfaces

What are the benefits of using tangible interfaces compared with other interfaces like GUI, pen-based or gesture?

  Documentation sheet author-purpose

Data imported from SalesData.csv text file located in Course Project Materials in DocSharing. Professional formatting follows the formatting guidelines. Documentation sheet added to provide author, purpose, and date and provide information about e..

  Prepare a powerpoint presentation explaining

Prepare a PowerPoint presentation explaining the results and recommendations of your assessment to senior management of the organization.

  Research a specific brand name secure usb thumb drive

Research a specific brand name secure USB Thumb drive and list the security advantages. Discuss its specifications. How does it compare with a cloud application of similar functionality? Name two of these services.

  Create a class list containing class node

1. Create a simple linked list program to create a class list containing class node { void *info; node *next; public: node (void *v) {info = v; next = 0; } void put_next (node *n) {next = n;} node *get_next ( ) {return next;} void *get_info ( ) {retu..

  Why is the pcm sampling time

Radio Antennas work best when the diameter of the antenna is equal to the wave length of the radio wave. Reasonable antennas range from 1 cm to 5 meters in diameter. What frequency range does this cover?

  Many-to-many relationship

What are some issues when working with a many-to-many relationship? Provide some examples.

  Which mib group contains this information

A network manager discovers that a network component is performing poorly and issues an order to the technician to replace it. Which MIB group contains this information for the technician to find out the physical location of the component?

  Investigate and discuss how data is structured

Choose any two of the problem areas and discuss in detail how the database approach solves the problem when compared to alternative approaches.

  Have you ever copied things from one document to another

Have you ever copied things from one document to another or from Word to PowerPoint, or any variation like that? Do you find it useful

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd