0% found this document useful (0 votes)
115 views2 pages

Exercise 5 - 1Q18-19 CS126-8L

The document provides instructions for Program Exercise #4 in the CS126L course. Students are asked to create a C++ program that uses a switch case statement to prompt the user to enter a letter from A-Z and display a corresponding object. The program must include error handling for invalid input using a default case, use a do-while loop for input validation, and nested loops to display each letter pattern. Students are also instructed to include specific programming comments, save the file to the network drive with a specified naming convention, and submit it to Blackboard before the deadline.

Uploaded by

asdasd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views2 pages

Exercise 5 - 1Q18-19 CS126-8L

The document provides instructions for Program Exercise #4 in the CS126L course. Students are asked to create a C++ program that uses a switch case statement to prompt the user to enter a letter from A-Z and display a corresponding object. The program must include error handling for invalid input using a default case, use a do-while loop for input validation, and nested loops to display each letter pattern. Students are also instructed to include specific programming comments, save the file to the network drive with a specified naming convention, and submit it to Blackboard before the deadline.

Uploaded by

asdasd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

CS126L – Problem Solving and Programming 1 (Laboratory)

Program Exercise # 4 –C++ PROGRAMMING


Directions:
1. For each solution you need to put on the following program comment indicating the
problem number, your name, today’s date, and your terminal no.
Ex. /*
* Programmer: FUENTES, Gloren S.
* Date Created: 10/14/2017
* Terminal No: 00
* Program: BSCS/BSIT
* Course / Section: CS126-8L/AT2
* Purpose: This program will calculate the speed from distance over time (or
copy and paste the given problem)
*/
2. Save a copy of your program to drive z (mapped network drive) with a filename
YNAME_EXER05.cpp (i.e. for your solution, your filename should be GFUENTES_EXER05.cpp)

3. Once done, your file (.cpp) must also submit to the blackboard account for checking
5minutes before the time submission. Failure to submit will get a grade of ZERO for this
exercise.

4. Failure to follow instructions will get a deduction of -5 points. PLEASE BE GUIDED.

Exercise 5 (100 points)

Using switch case statement, create a C++ program that will prompt the user to enter a
letter in an alphabet A-Z and display the corresponding object.
***NOTE:
1. use an error handle (default if choice is invalid) and do-while loop for input
validation.
2. use nested loop for EACH letter inside the case of switch
3. topic from this exercise is only up to Iterative – nested loop
4. If you do not follow the requirements DEDUCTIONS will apply to your exercise 5.

Use do-while loop to repeat the entire process of the program.

Below are the patterns you may use in displaying the letters of the alphabet
Sample output:

Enter an Alphabet letter from A-Z: 1


Invalid Alphabet must be from A-Z only!
Enter an Alphabet letter from A-Z:N
N N
N N N
N N N
N N N
N N
Do you want to try again?[y/n]:L
Do you want to try again?[y/n]:Y
Enter an Alphabet letter from A-Z:N
N N
N N N
N N N
N N N
N N
Do you want to try again?[y/n]:N

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy