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

Prelim Machine Exercises

This document provides instructions and examples for programming exercises that are due by January 2, 2011. It lists 6 exercises that students must complete, with Exercises 1-3 being minor programs and Exercises 4-6 being major machine exercises. Strict guidelines are given around formatting, submitting, and not copying code. The exercises involve writing programs to check if a number is within a range, print a range of numbers using loops, perform math operations on an integer using a menu/case statement, print a diamond pattern, and print a triangular pattern.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views2 pages

Prelim Machine Exercises

This document provides instructions and examples for programming exercises that are due by January 2, 2011. It lists 6 exercises that students must complete, with Exercises 1-3 being minor programs and Exercises 4-6 being major machine exercises. Strict guidelines are given around formatting, submitting, and not copying code. The exercises involve writing programs to check if a number is within a range, print a range of numbers using loops, perform math operations on an integer using a menu/case statement, print a diamond pattern, and print a triangular pattern.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

PROGRAMMING II MACHINE EXERCISES

DEADLINE ON OR BEFORE JANUARY 2, 2011 LATE SUBMISSION WILL NOT BE ENTERTAINED. STRICTLY NO COPYING FROM YOUR CLASSMATES AND IN THE INTERNET! Exercises are just minor program while Machine Exercise is a Major Program.

Format for submission: Folder Name: yourname_Year&Block Format for individual program exercise: exercisename#_lastname.cpp Note: Follow the correct format given, those who did not follow the format, programs will not be accepted! Those who will submit early will be given extra points. Submit it to me in person. Only soft copy.

EXERCISE 1 Write a program that asks the user to type an integer and writes "YOU WIN" if the value is between 56 and 78 (both included). In the other case it writes "YOU LOSE".(Hint Use if else statement) EXERCISE 2 Write a program that asks the user to type all the integers between 8 and 23 (both included) using a for loop.

EXERCISE 3 Same exercise but you must use a while.

MACHINE EXERCISE 4 Write a program that is able to compute some operations on an integer. The program writes the value of the integer and writes the following menu (USE CASE STATEMENT HERE) a. Add 10 b. Multiply by 2 c. Subtract 4 d. Divide by 8 e. Quit

The programs ask the user to type a value between a and e. If the user types a value from a to d the operation is computed, the number is written and the menu is displayed again. If the user types e, the program quits. Note in this program, when you choose a it is the same as A, these goes for all. MACHINE EXERCISE 5: Create a program that will output a diamond pattern as shown below.

MACHINE EXERCISE 6

Simplified Program for Machine Exercise 5: Print out the following triangular patter

Happy holidays!
~ maze ~

You might also like