Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

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)

111 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