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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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