labAssignment9 - Semester: Fall 2009 Assignment: Lab09...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 /* Lab assignment 9 Kasey Scott [email protected] This program had errors that needed to be fixed to get the cout correctly*/ #include <iostream> int main() { float val, sum, incr int ok,num cout << "CSE 1020.301 L10 Lab 9 Kasey Scott [email protected]" << endl << endl ok = 0 // This was an infinite loop needed to increment ok to end loop while (!ok) { cout << "Enter an even number: " cin >> num // Fix condition so that reconized the positive even number if (num % 2 == !0 || num < 0) cout << "The number " << num << " is not a positive even number." << endl else ok++ }// end of loop cout << endl << endl // must make 1 a floating point number incr = 1.0 / num // must initalize sum sum = 0 // in for loop cout add a space between val for (val = 20.0F cout << val << " " sum += val } // end for loop cout << endl << "The sum is " << sum << endl return 0 } Course: CSE 1020 C/C++ Programming for Non-Majors
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

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

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Semester: Fall 2009 Assignment: Lab09 Student: Kasey Scott ID: kms0300 Email: [email protected] webCompiler for C/C++ Sheet1 Page 2 Your submission has been successfully turned in. Name: Kasey Scott ID: kms0300 Email: [email protected] Assignment: Lab09 Course: 1020 Section: 301 Fall 2009 Assignment Due Date: 11/15/2009 Date/Time Submitted: 11/15/2009, 11:13 pm This is your 2nd submission for this assignment Confirmation Code: 1258348401-1493616106 Please print this page for confirmation purposes. kms0300 logged in 0 minutes, 26 seconds UEdSys webCompiler Elapsed Time: 0.155 secs WARNING - In accordance with the State of Texas security standards: Unauthorized use is prohibited. Usage may be subject to security testing and monitoring. Abuse is subject to criminal prosecution. Sheet1 Page 3 val <= 21.0 val += incr) { Sheet1 Page 4...
View Full Document

This note was uploaded on 03/05/2010 for the course DSDDDDDDD dddddfvvc taught by Professor Cxcseef during the Spring '10 term at École Normale Supérieure.

Page1 / 4

labAssignment9 - Semester: Fall 2009 Assignment: Lab09...

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

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