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 a credit approval application for retail store

You have been asked to create a credit approval application for retail store. To get approved for credit card customer must meet the following criteria: Should be 18 years of age or older

  Write program that computes loan payments

Write a program that computes loan payments. The loan can be a car loan, a student loan, or a home mortgage loan. The program lets the user enter the interest rate.

  Create a menu type form that gives user to select subforms

Create a menu type form that provides the user the capability to select one of the following two subforms. Means of selection is programmers choice.

  Design and implement program catches and handles exception

Design and implement a program that creates an exception class called StringTooLongException, designed to be thrown when a string is discovered that has too many characters in it.

  Create class using static variable to store annual interest

Create class SavingAccount. Use a static variable annualInterestRate to store the annual interest rate for all account holders. Each object of the class contains a private instance variable savingsBalance indicating the amount.

  Method to pass string argument and returns first line

Write a method, getFirstLine, that is passed a String argument and that returns the first line.

  Designing the site links

Company needs to be able to schedule the time of day when the connections are available for replication. Replication should not occur during peak business hours. When designing the site links, which of the following options should you use?

  Create class for factory workers are paid certain amount

Create class for Factory workers are paid a certain amount for each unit they make and their total pay is the number of units produced times the pay per unit.

  Design logic for application to allow user to enter item

Design the logic for an application that allows a user to enter an ordered item continuously until a sentinel value is entered. After each item, display its price or the message.

  Explain the functions which are useful

Explain some of the functions which you have found useful, where you found them, and how you use them. Describe good programming practices.

  Cooks selected by methods are different which one is taller

He orders the shortest man in each column to step aside and chooses the tallest of these twenty-five. The two cooks chosen by the two methods are different. Which one is taller?

  Write gui program as subclass of jframe

Write a GUI program as subclass of JFrame. It should contain the following: Labels At the top (column headings): Meal, Quantity, Cost, At the left: label for each mea.

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