Use the readline() method to obtain a value from the user

Assignment Help Basic Computer Science
Reference no: EM13271352

Write a code segment that will analyze a numeric value provided by the user to determine if he or she is a newborn, a child, a teenager, or an adult. Make sure to include the following in your code:

· Display the message "Please enter your age in years" to the user.
· Use the ReadLine() method to obtain a value from the user.
· Use the Parse() method to convert the user's value to an appropriate data type for numeric comparisons.
· Check to be sure the user entered a value greater than or equal to 0 and less than or equal to 150.
· Use ElseIf statements to determine the stage of life associated with the user's input. An input value of 0 indicates the user is a newborn. An input value of 1 up to but not including 13 is a child. An input value of 13 up to but not including 20 is a teenager. An input value of 20.0 or more is an adult.

Reference no: EM13271352

Questions Cloud

Leading consultants for a number of patients : Doctors are specialists in some branch of medicine and may be leading consultants for a number of patients, not necessarily from the same ward.
Compute the focal length of the concave mirror : A light bulb is placed 22.3 cm in front of a concave mirror. Calculate the focal length of the concave mirror
How far is the base of the smokestack from the life ring : A diver beneath the surface of water in a lake looks up at 27 degrees from the vertical to see a life ring floating on the surface. How far is the base of the smokestack from the life ring
Computing the degree of ionic character of each bond : Calcite (CaCO3) has two types of bond. (covalent and ionic) a) Demonstrate which is the stronger by calculating the degree of ionic character of each bond
Use the readline() method to obtain a value from the user : Write a code segment that will analyze a numeric value provided by the user to determine if he or she is a newborn, a child, a teenager, or an adult. Make sure to include the following in your code:
What was the rate of price appreciation for year : Electronics, Inc. common stock returned a nifty 22.68% rate of return last year. The dividend amount was $0.25 a share which equated to a dividend yield of 0.84%. What was the rate of price appreciation (capital gain) for the year?
Compute the equivalent values for the bonds : Anhydrite (CaSO4). Calculate the equivalent values for the bonds in anhydrite and comment on the differences between the two minerals.
What is the filter output if the bandwidth is b hz : A signal x(t)=sinc(200*pi*t) is sampled (multiplied) by a periodic pulse train. Find and sketch the spectrum of the sampled signal. Explain whether you will be able to reconstruct x(t) from these samples.
What was the average annual growth rate : At the end of the year 2002, the firm paid a dividend of $1.35. At year-end 2009, it paid a dividend of $1.84. What was the average annual growth rate of dividends for this firm?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Develop leftmost and rightmost derivations

Develop leftmost and rightmost derivations respectively for the Identifier value S6T, using the following BNF syntax:

  Write code that fills an array with each set of numbers

Write code that fills an array with each set of numbers below. a. 1 2 3 4 5 6 7 8 9 10 b. 0 2 4 6 8 10 12 14 16 18 c. 1 4 9 16 25 36 49 64 81 100 d. 0 0 0 0 0 0 0 0 0 0 e. 1 4 9 16 9 7 4 9 11

  Flowchart, psuedocode and desk check

Flowchart, psuedocode and desk check

  What is maximum size of a file can be stores in file system

This file system has 12 direct disk blocks, as well as single, double, and triple indirect disk blocks. What is the maximum size of a file that can be stores in this file system?

  What are purpose active directory folders and limitatation

What are purpose of Active Directory folders (not share folder)

  Examine work-related project using systems analysis

Create 4-6-page paper which examines work-related project which used systems analysis for selected business system at department or division level.

  Create a class titled schooltextbook that contains fields

Create a class titled SchoolTextBook that contains fields for the author, title, page count, ISBN, and price. This SchoolTextBook class will also provide setter and getter methods for all fields.

  How to make sure that written work is free of grammar

How do you make sure that written work is free of grammar and spelling errors? Write down tools or secrets do you use?

  Determining minimum size of control bus

Determine the minimum size of the control bus?

  Compute millions of instructions per second of program

Compute the MIPS (Millions of Instructions Per Second) rating for each processor during execution of this particular program

  Design an asynchronous base 14 counter

Design an asynchronous base 14 counter that counts through the natural binary sequence from 0 (0000) to 13 (1101) and then returns to zero on the next count.

  Describe the concept of form follows function

Describe the concept of "Form Follows Function" as it pertains to the three main areas of design (FAB). Recognize ways in which portfolio designer works within limitations of media technology (Functionality).

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