Write program that asks user for two digit number

Assignment Help Programming Languages
Reference no: EM1367862

Write a program that asks the user for a two digit number and then prints the English word for that number.

Sample run:
Enter a two-digit number: 45
You entered the number forty-five.

PLAN: Read the number entered as an integer and then break the number up into 2 digits. (Recall how integer division and % work...if x is an int and has the value 45, then what's x/10 and x%10?)

Basically, use one switch statement to print the word for the first digit ("twenty", "thirty" and so forth). Use a second switch statement to print the word for the second digit.
Don't forget the numbers between 10 and 19 require special treatment.
Make sure you only print the ‘-‘ when needed...twenty-three needs the -, thirty doesn't.

Reference no: EM1367862

Questions Cloud

Detemining mark up pricing : Many retail companies use mark up pricing? Setting price some percentage above variable cost (such as 50% above cost).
Politicians economic interests : Presidents, senators and members of congress came from a different backgrounds but all must decide upon a great many issues that involve macroeconomics.
Staff develpoment in a hospital : For a nurse who plans to seek a job in education (staff develpoment in a hospital).
Briefly state basic characteristics of pure competition : Briefly state basic characteristics of pure competition, pure monopoly, monopolistic competition and oligopoly. Under which of se market classifications does each of following most accurately fit.
Write program that asks user for two digit number : Write program which asks user for two digit number and then prints English word for that number. Sample run: Enter a two-digit number: 45
Computing marginal costs with excel : Using the given table, find out the quantity where MC = ATC. Find out the quantity where ATC is at its minimum. Find out the quantity that is the most efficient operating point for the firm.
How will this involvement affect economic efficiency : When government becomes heavily involved in tax-transfer activities, how will this involvement affect economic efficiency.
Nursing theorists-parse and watson : Compare and contrast the nursing theorists, Parse and Watson, comprise similarities, dissimilarities (totality versus simultaneity, paradigms), schematic model aspects of the theories
Decision to produce or shut down : Say half of the cost of producing wheat is rental cost of land (a fixed cost) and half is cost of labor and machines (a variable cost). If the average total cost of producing wheat is $8 and price of wheat is $6, what would advise the farmer to do..

Reviews

Write a Review

Programming Languages Questions & Answers

  Create new method public to create and return new picture

Create a new method public Picture frame (int frameSize, Color frameColor) this method will create and return a new picture object.

  Include hyperlink for confirming order in online ticket

Include a check box for attending the Awards Event. Include a hyperlink for confirming the order. Make the link invisible to begin but display it after the Submit button has been clicked.

  Develop logic to accept number of passengers-zones as input

Develop the logic for a program that accepts the number of passengers and zones crossed as input. the output is the ticket charge.

  Write script in fedora to automate complex system task

Write a script in fedora 10 that will automate a complex system task. The task I have chose is one that will determine the processes that are consuming system resources.

  Write a program to print average grade of student

Write a program that read the grades.txt file and then prints the average grade of male and female students and the number of passed students by using the functions.

  Complete a request for system services

Objectives Complete a Request for System Services form, which triggers the preliminary investigation phase. Analyze a user interview and extract pertinent facts, which can be used to assess project feasibility. Complete a Problem Stateme..

  Create a new console application project

Create a new console application project and name it "Week1Lab_BirdN". Create the necessary member functions that will perform the required operations outlined in the lab summary above.

  Program to track which user is logged onto which computer

Write a computer program that could be used to track, by lab, which user is logged onto which computer.

  Define four user-defined exceptions

You will need to define four user-defined exceptions; one for unknown movies, one for unknown member, one for unknown payment method.

  Write program to accept data for each student

Write a program that accepts data for each student in the school - Student ID, classroom number, and score on the achievement test. Design a program that lists the total points scored for each of the 30 classrooms.

  Create application which permits user to input a price

Create an application which allows a user to input a price until suiatble sentinel value is entered. Output is a price of each item on each day,one through seven.

  Program to compute perimeter and area of rectangle

Write a program that asks for length L and the width W of a rectangle, then compute perimeter and area of the rectangle.

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