Homework

profilegrarod
programming_problem.docx

New Programming Problem:

 

Design and write a application using pseudo code, that takes as input a single letter and displays the corresponding digit on the telephone. The letters and digits on a telephone are grouped this way:

 

2 = ABC                     4 = GHI                      6 = MNO                    8 = TUV

3 = DEF                      5 = JKL                       7 = PRS                       9 = WXY

 

No digit corresponds to either Q or Z.  For the two letters, your application should display a message indication that they are not used on a telephone.

 

The screen dialog might look like this:

 

Enter a single letter, and I will tell you what the corresponding digit is on the telephone.

 

R

 

The digit 7 corresponds to the letter R on the telephone.

 

Your code should display a message indication that there is no matching digit for any non-alphabetic character entered by the user. Also, the application should recognize upper or lower case letters.

Use proper indentation, appropriate comments, and meaningful identifiers throughout the code.

Old Homework Answer:

/*This program will be used to convert the temperatures from Fahrenheit to Celsius and from Celsius to Fahrenheit for the Temperature Convention Center. */  

Declare Celsius and Fahrenheit as float

Declare x,y, choice as char

Write: “Welcome to the Temperature Conversion Center! This program will allow the user to”

Write: “enter a series of Degree Celsius temperatures that you want to convert to Degree”  

Write: “Fahrenheit or Degrees Fahrenheit to Degrees Celsius! Your converted temperatures”

Write: “will be displayed on the screen! Press letter x if you want to convert Degrees Fahrenheit”

Write: “to Degrees Celsius or y if you want to convert Degrees Celsius to Degrees Fahrenheit”

Input choice

If (choice==x)

Input Fahrenheit

Celsius = (Fahrenheit – 32) * 1.8

Write: +Celsius+ “degrees Celsius is” +Fahrenheit+ “degrees Fahrenheit \n”

Else if (choice==y)

Input Celsius

Fahrenheit = (Celsius* 9)/5 + 32

Write: +Fahrenheit+ “degrees Fahrenheit is” +Celsius+ “degrees Celsius \n”

Else

Write: “sorry, use the allowed options that is x and y \n”

End If

Write: “The conversion from Celsius to Fahrenheit and Fahrenheit to Celsius has ended,”

Write: “Thank you for using this program!”