1
Mech 215 Lab #1 1) Become familiar with how to use the Visual C++ 2012 compiler in the lab rooms. Also make sure you can use the debugger on these computers. 2) Learn how to create a new Win32 console application from the Visual C++ menu. To do this select File->New->Project and then select Win32 Console Application. Make sure you also know where to locate the files for the new project and how to open the project after you have closed it. 3) Write a program that calculates the squares and cubes from all integer numbers from 0 to 5. Your program must produce a formatted table such as: integer 0 1 2 ... square 0 1 4 ... cube 0 1 8 ... 4) Write a program that inputs three different integers from the keyboard and prints the sum, average, product, smallest and largest of these numbers. The screen dialog should appear as follows: Input three different integers: 13 27 14 Sum is 54 Average is 18 Product is 4914 Smallest is 13 Largest is 27

mech215_lab1

Embed Size (px)

DESCRIPTION

industrial and mechanical engineering computational and procedural programming

Citation preview

Page 1: mech215_lab1

Mech 215 Lab #1

1) Become familiar with how to use the Visual C++ 2012 compiler in the lab rooms. Also make sure you can use the debugger on these computers.

2) Learn how to create a new Win32 console application from the Visual C++ menu. To do this select File->New->Project and then select Win32 Console Application. Make sure you also know where to locate the files for the new project and how to open the project after you have closed it.

3) Write a program that calculates the squares and cubes from all integer numbers from 0 to 5. Your program must produce a formatted table such as:

integer 0 1 2 ...

square 0 1 4 ...

cube 0 1 8 ...

4) Write a program that inputs three different integers from the keyboard and prints the sum, average, product, smallest and largest of these numbers. The screen dialog should appear as follows:

Input three different integers: 13 27 14Sum is 54Average is 18Product is 4914Smallest is 13Largest is 27