Statement - Computers and Programming I - Home Work, Lecture notes of Computer Programming

Some concept of Computers and Programming I are Assign Value, Single-Subscripted Array, Class Members, Current Precision, Elementary School, Complete Program, Fibonacci Sequence, Programming Errors. Main points of this homework are: Statement, Applies, Program, Company Pays , Per Week, Gross, Sales, Commission Basis, Salespeople, Earned

Typology: Lecture notes

2012/2013

Uploaded on 04/27/2013

kid
kid ๐Ÿ‡ฎ๐Ÿ‡ณ

4.3

(18)

110 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Question 1
Assume that the following statement applies to a program.
Write a statement that opens file โ€œoldmast.datโ€ for input; use ifstream object
inOldMaster.
Question 2
Assume that the following statement applies to a program.
Write a statement that opens file โ€œtrans.datโ€ for input; use ifstream object
inTransaction.
Question 3
Assume that the following statement applies to a program.
Write a statement that opens file โ€œnewmast.datโ€ for output; use ofstream
object outNewMaster.
Question 4
Assume that the following statement applies to a program.
pf3

Partial preview of the text

Download Statement - Computers and Programming I - Home Work and more Lecture notes Computer Programming in PDF only on Docsity!

Question 1 Assume that the following statement applies to a program. Write a statement that opens file โ€œ oldmast.dat โ€ for input; use ifstream object inOldMaster.

Question 2 Assume that the following statement applies to a program. Write a statement that opens file โ€œ trans.dat โ€ for input; use ifstream object inTransaction.

Question 3 Assume that the following statement applies to a program. Write a statement that opens file โ€œ newmast.dat โ€ for output; use ofstream object outNewMaster.

Question 4 Assume that the following statement applies to a program.

Write a statement that reads a record from the file โ€œ oldmast.dat โ€. The record consists of integer accountNum , string name and floating-point currentBalance ; use ifstream object inOldMaster..

Question 5 Assume that the following statement applies to a program. Write a statement that reads a record from the file โ€œ trans.dat โ€. The record consists of integer accountNum , floating-point dollarAmount ; use ifstream object inTransaction.

Question 6 Assume that the following statement applies to a program. Write a statement that writes a record to the file โ€œ newmast.dat โ€. The record consists of integer accountNum , string name , and floating-point currentBalance ; use ofstream object outNewMaster.

Question 7

Write a program that uses the sizeof operator to determine the sizes in bytes of the various data types on your computer systems. Write the results to the file โ€œ datasize.dat โ€ so you may print the results later. The format for the results in the file should be

Date type Size