Putting validation into a function

Assignment Help C/C++ Programming
Reference no: EM133201468

Program 1

Ask the user for their initials and save them into a char array. Then, ask the user for their age, and save it in an integer. Make sure that your age input is validated so that only numeric data will be accepted. HINT: Putting this validation into a function (aka method) will be helpful for other numeric inputs in this lab. Multiply the age by 365 to get the days that they've been alive (we don't care about leap years, they're worthless). Finally, display everything back to the user.

Example Output

Please enter your initials: TJ

Please enter your age: 999

TJ, did you know you're at least 364635 days old?

Reference no: EM133201468

Questions Cloud

Which of the two methods of estimating uncollectible provide : Which of the two methods of estimating uncollectible provides for the most accurate estimate of the current net realizable value of the receivables?
Define the term co-insurance : Define the term "co-insurance." Where does co-insurance apply within your coverage? How does co-insurance differ from co-pay
What will be the result : LAW 101 Saudi electronic university - How could this dispute have been avoided in the first place - dispute over the profits arises, and ultimately a court
Discuss what a marketing plan is : Discuss what a marketing plan is and describe the different components of the marketing plan in your own words (see figure 16.2 in the text).
Putting validation into a function : Ask the user for their initials and save them into a char array. Then, ask the user for their age, and save it in an integer. Make sure that your age input is v
Impact of technology in emergency management : Northcentral University - describe three new technologies that have greatly assisted emergency managers in the last 5 years. Consider emerging technologies
Complete your Gemba Walk and document your observations : Complete your Gemba Walk and document your observations. Write a 4- to 6-page report on your observations of your Gemba
Monitoring the admissions to clinic : A hospital ER manager has been monitoring the admissions to her clinic over the course of a week. The data she collected is found in the clinic.csv file in your
Create the dream team without boundaries : With all these wonderful components there are many issues and might have a large negative impact to the whole process of creating a virtual team and working

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Creating a database design in visior

Use "Appendix A: Designing Databases with Visio Professional: A Tutorial," to help you complete Section 1: Visio Database Design. (Note: This tutorial focuses on the use of Microsoft Visio. Open source applications are not covered in Appendix A..

  Program that asks the user to enter a number from 1 to 50

Print the statement "Programming is fun" the number of times entered by the user using a for loop.

  Write and simulate the three y86-64 programs

Your task is to write and simulate the following three Y86-64 programs. The required behavior of these programs is defined by the example C functions.

  Write pseudocode for a program

Write pseudocode for a program that prompts the user for a month and day and prints out whether it is one of the following four holidays.

  Write binary string for number to file

Convert each string to a numeric representation (without using stoi() or similar functions from the string library).

  Determine whether or not there is data pertaining

For each employee you are to compute the number of overtime hours worked by that employee, the salary, and the overtime pay. An employee earns straight time for the first forty hours of work, time-and-a-half for up to the first 10 hours in excess ..

  Write a test program that prompts the user to enter an index

Rewrite the fib method in Listing 18.2 using iterations. Hint: To compute fib(n) without recursion, you need to obtain fib(n - 2) and fib(n - 1) first. Let f0 and f1 denote the two previous Fibonacci numbers. The current Fibonacci number would the..

  Implement a class that supports an extendable variant

In this exercise you will practice basic C++ class construction, and memory allocation and deallocation. You are asked to implement a class that supports an extendable variant of a sparse matrix (look it up). A matrix is a two-dimensional array

  Write a function to determine the various transactions

Given a I2C trace file, write a function to determine the various transactions. The trace files are provided in the zip file.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write a function for upper triangular matrix

Write a function 'function x = u solve(A,b)' to solve Ax = b when 'A' is a upper triangular matrix.

  Write a program that will generate random numbers

Write a C++ program that will generate random numbers between the ranges of your own choice and within the random numbers, indicate the maximum, minimum.

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