report - A final reading that is less than the initial...

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

View Full Document Right Arrow Icon
Project 2—Computer Science 31 Ahmad El-Arabi I did run into a few obstacles while writing the program for this project: 1. Was not sure as to how to check whether a string is empty or not. Solved this problem by asking my TA, and having him tell me about the function empty() . This function gives back either true or false depending on whether the string is empty or not. 2. When first testing the program, I ran into the following problem, The reason this was occurring was that I had forgot to insert the line cin . ignore ( 100000 '\n' ); ” before writing the lines asking the user to input their name. 3. Lastly, when printing out the amount to be paid for the bill, I kept getting a different number of decimal points. I solved this problem by using the following three lines of code before printing out the final answer, cout . setf ( ios ::fixed); cout . setf ( ios ::showpoint); cout . precision ( 2 ); The following was the test data that I used to test my program: An initial meter reading less than zero. (-22; 100; Ahmad; 3)
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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: A final reading that is less than the initial reading. (100; 99; Ahmad; 3) No customer name inputted. (100, 150, , 3) An invalid input for the month; month number larger than 12. (100, 150, Ahmad, 13) An invalid input for the month; month number less than 1. (100, 150, Ahmad, 0) Bill for a month during high usage season, but less than 46 HCF. (100, 130, Ahmad, 7) Bill for a month during low usage season, but less than 32 HCF. (100, 130, Ahmad, 1) Bill for a month during high usage season, but more than 46 HCF. (100, 150, Ahmad, 7) Bill for a month during low usage season, but more than 32 HCF. (100, 150, Ahmad, 1) Bill for a month during high usage season, but exactly 46 HCF. (100, 146, Ahmad, 7) Bill for a month during low usage season, but exactly 32 HCF. (100, 132, Ahmad, 1) Same initial reading as final reading, (100, 100, Ahmad, 3)...
View Full Document

This note was uploaded on 09/24/2009 for the course BIOENGR 10 taught by Professor Staff during the Spring '08 term at UCLA.

Page1 / 2

report - A final reading that is less than the initial...

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