

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
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
1 / 3
This page cannot be seen from the preview
Don't miss anything!


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