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

  Override the insert method in bst

You should override the insert method in BST. Your overriding method should first call the method it is overriding. When 50 insertions have been performed since the last rebalancing.

  File contains data for an individual wedding album

Each line of this file contains data for an individual wedding album and delivery. These data  are used to determine the total cost of producing and posting a batch of albums to a  customer. Each column of this file contains values for the following..

  Wearable computing technology

A REPORT OF WEARABLE COMPUTING TECHNOLOGY IN RESOLVING TIME SHEET ISSUES FOR PAYROLL SYSTEM INPUT TO THE CEO

  Explain how objects are created in java

Explain how objects are created in Java and how the memory used by objects is recovered. Compare this to object creation and destruction in C++.

  A direct-mapped cache with 8 two-word blocks

Based on the following sequence of word addresses generated by the processor:1, 134, 212, 1, 135, 213, 162, 161, 2, 44, 41, 221a) Given a direct-mapped cache with 8 two-word blocks that is initially empty

  Solve the following logcal problems

Solve the following logcal problems: a. 10110001 OR 00011010 b. 11100110 XOR 10111011

  Write the function comb

Write the function comb, computing(n,m) in such a way that when we call comb(n,m) it prints n and m before printing the result. Print out suitable words so n, m, and (n,m) are clearly distinguishable from one another.

  Provide a recursive definition of sequence s

provide a recursive definition of sequence S of all Binary strings starting with 1. Include the base case, recursion and restriction.

  Write a program that computes terms of the fibonacci series

Write a program that computes terms of the Fibonacci series

  Data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs, Flash RAM, and solid-state drives

  Differentiate computer data state of computer-s electrical

Differentiate between computer data represented by the state of a computer's electrical switches and the meaningful information that is displayed to the user.

  Two cyborgs walk into your home

Two cyborgs walk into your home, both claiming to be oracles for the graph 3-colorability decision problem. They both always give a yes/no answer in constant time for any instance, and are each self-consistent

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