Question: 4 . 3 Programming Project # 0 2 C Program Specifications Write a program to input a phone number and output a phone directory with
Programming Project #C
Program Specifications Write a program to input a phone number and output a phone directory with five international numbers. Phone numbers are divided into four parts: country code, area code, prefix, and line number. For example, a phone number in the United States is
Note: this program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress.
Step pts Read from input an area code, prefix, and line number integers Output the directory heading two lines Insert two blank spaces between Country and Phone and the horizontal line is created with dashes not underscores Output a phone number for the United States with country code using proper format. Submit for grading to confirm tests pass.
Ex: If the input is:
The output is:
Country Phone Number
US
Step pts Output a phone number for Brazil with country code and add to the prefix. The prefix variable should not change. Instead, add to the prefix within the print statement. For example, System.out.printlnprefix ; Submit for grading to confirm tests pass.
Ex: If the input is:
The output is:
Country Phone Number
US
Brazil
Step pts Output a phone number for Croatia with country code and add to the line number. Output a phone number for Egypt with country code and add to the area code. The variables should not change. Instead, add values within the print statement as in Step Submit for grading to confirm tests pass.
Ex: If the input is:
The output is:
Country Phone Number
US
Brazil
Croatia
Egypt
Step pts Output a phone number for France with country code and swap the area code with the prefix. Submit for grading to confirm all tests pass.
Ex: If the input is:
The output is:
Country Phone Number
US
Brazil
Croatia
Egypt
France
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
