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

  Assess an organisation information system

Journal task is to assess an Organisation Information System, and write a report. The assessment should focus on the various components of business systems

  Role of operating system

Title: Role of Operating System Answer these review questions based on operating systems:

  Define a good design process and incorporates sequential

Design a program that will allow a user to Input a list of his Classmatess along with their Gender(Male, Female), Age and City where they reside. You must first collect all the information from the user. Then determine and print the average age of..

  Exploited both network and host vulnerabilities

Several computers in your company have recently been compromised. It was discovered that your company network had been under attack for several months. However, these attacks had not been previously detected. The attackers exploited both networ..

  What is the function of secondary storage

What is the function of secondary storage? Describe three types of secondary storage media, and describe the advantages and disadvantages of each type.

  Discuss the issues of encryption and key management

Discuss the issues of encryption and key management in cloud computing, how it different for personal computers and traditional enterprising computing environments.(1300-1400 words)

  Explain nefarious computer activities known ping sweeps

Write short description of what they are and include assessment of whether this activity is something to worry about or not.

  Identify potential weaknesses of quality web design company

Identify potential weaknesses from either the Aircraft Solutions or Quality Web Design Company. In this phase, you will choose either Aircraft Solutions or Quality Web Design as the company you will work with.

  What does power consumption have to do with the fact

What does power consumption have to do with the fact that most modern processors have multiple cores - Which of the given statements about how modern computers are built is/are true?

  Investigation of object-oriented programming by creating

We begin our investigation of object-oriented programming by creating an object-oriented program with a class called Employee. You will create two objects based on the Employee class, along with a class that contains the main method. The attributes, ..

  What does it mean to take a systems view of a project

As an IT project manager, you may take a systems view of a project.

  Construct the truth tables for the

Which of the following sentences are logical statements. Construct the truth tables for the following propositions

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