Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Introduction Lab 4 - Selection For this lab, you will complete the following steps: Create an algorithm to solve the problem described below. Create

image text in transcribedimage text in transcribed

Introduction Lab 4 - Selection For this lab, you will complete the following steps: Create an algorithm to solve the problem described below. Create a test plan (a set of test cases) to test the program. Write a program and test it using your test cases. Upload the program to Gradescope, which will test your program and inform you of any errors; then correct your program if necessary and resubmit it, until all errors are corrected. Submit the test plan via Canvas. Part 1: Algorithm 1. Develop an algorithm for a Java program that takes as input a single letter and then displays the corresponding digit from a classic telephone dialpad. The algorithm should be written in pseudocode. Letters and digits are grouped this way: + 13:26 dialer calllog contact 1 2 2 = ABC 6 = MNO 3 = DEF 7 = PQRS 4 = GHI 8 = TUV 5 = JKL 9 = WXYZ GHI 2. The program should prompt the user with the following message, and then input one character. Enter a single letter, and I will tell you what the corresponding digit is on the telephone ABC JKL TUV 3 DEF 6 MNO 9 WXYZ 7 PQRS 8 * 0 + # www.gplexdialer.com Part 3: Program 5. Write the Java program PhoneSelection.java, from the algorithm you designed in Part 1. Include your algorithm steps as comment blocks before the code that executes each step. Use proper indentation, and meaningful identifiers throughout the code. 6. To capture a character from the keyboard, use this code (where Scanner is replaced by the name of the Scanner object): char letter = Scanner.next().charAt(0); This line of code will input a String using .next() and then will isolate the first character from that String using .charAt(0). 7. A character can be converted to upper-case using the toUpperCase() utility method of the Character class (replace 'char' with the name of your character variable). If the variable already contains an upper-case character, it will not change. char = Character.toUpperCase (char); 8. Place a standard comment block at the top of the Java program, including the program name, program description, your name, the date, and course-section number. 9. Run each of the test cases that you created and record the results on the testing document. 10. Once you are done testing your code, upload PhoneSelection.java to Gradescope (there is a link in Canvas). Upload the file to the Lab 4 submission area. Check for the output of the test cases after Gradescope has completed testing the program. If necessary, correct your code until all test cases pass. 11. Submit your completed Test Plan via Canvas.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions

Question

What was the influence of the individual experimenter?

Answered: 1 week ago

Question

How will CompTIA Security + certification advance your career?

Answered: 1 week ago

Question

5. What is a buffer? Why do some critics consider it unethical?

Answered: 1 week ago

Question

2. What are the main goals in delivering bad news?

Answered: 1 week ago