Lab2A - COSC1415/COSC1436 Chapter 2A - Lab Assignment Page...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
COSC1415/COSC1436 Chapter 2A - Lab Assignment Page 1 of 1 Name Chintu Patel 8001 COSC1415/COSC1436 Chapter 2 Lab – Part A Use the introductory lab as a reference for this lab. Objective: At the end of this lab you should know: 1. the lines of code that are part of a standard C++ program. 2. how to write a C++ program using cout and cin statements. 3. how to use static_cast to convert from a decimal number to an integer. Lab 2A: 1 . Go to the C++ compiler and create a new project and program file. Write a program that prompts the user to input a decimal number. The program should output the decimal number and the corresponding integer. Label the output. (Add a cout statement at the beginning of your program that says: This program written by: <your name> ) Without changing the program in any way, run it twice. The first time enter 4.123 as the decimal number. The second time enter 6.987 as the decimal number. Print a copy of the program and the two sets of output. 2. Go to the C++ compiler and create a new project and program file. Write a program that does the following: a. Has a cout statement at the beginning of the program that says: This program written by: <your name> b. Prompts the user to input five decimal numbers (one number at a time) and reads one number at a time. c. Converts each decimal number to an integer. d.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/06/2008 for the course COSC 1436 taught by Professor May during the Spring '08 term at Dallas Colleges.

Page1 / 5

Lab2A - COSC1415/COSC1436 Chapter 2A - Lab Assignment Page...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online