Preview

Programm

Satisfactory Essays
Open Document
Open Document
463 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Programm
Programming exercises
1. Consider the following incomplete C++ program

#include

int main()
{
….
}

a. Write a statement that include the header files fstream, string, and iomanip in this program.
b. Write statements that declare inFile to be an ifstream variable and outFile to be an ofstream variable.
c. The program will read data from the file inData. txt and write output to the file outData. txt.
Write statements to open both of these files, associate inFile with inData. txt, and associate outFile with outData. txt.
d. Suppose that the file inData. txt contains the following data:

10.20 5.35
15.6
Randy Gill 31
18500 3.5
A

The numbers in the first line represent the length and width, respectively, of a rectangle. The number in the second line represents the radius of a circle. The third line contains the first name, last name, and the age of a person. The first number in the fourth line is the savings account balance at the beginning of the month, and the second number is the interest rate per year. (Assume thatp = 3.1416.) The fifth line contains an uppercase letter between A and Y (inclusive). Write statements so that after the program executes, the contents of the file outData. txt are as shown below. If necessary, declare additional variables. Your statements should be general enough so that if the content of the input file changes and the program is run again(without editing and recompiling), it outputs the appropriate results.

Rectangle:
Length = 10.20, width = 5.35, area = 54.57, parameter = 31.10

Circle:
Radius = 15.60, area = 764.54, circumference = 98.02
Name: Randy Gill, age: 31
Beginning balance = $18500.00, interest rate = 3.50
Balance at the end of the month = $18553.96

The character that comes after A in the ASCII set is B

e. Write statements that close the input and output files.
f. Write a C++ program that tests the statements in parts a through e.

4. During each summer, John and Jessica grow

You May Also Find These Documents Helpful

  • Good Essays

    A student writes a report using a word processor, saving the report in a file called my report. The student stores the file on his laptop hard disk drive. Later, he posts the file on a file-sharing site for a classmate to review the report. Then, he copies an updated version of the file to a flash drive to submit it to his instructor. Which of the following are some of the important features supplied by files as defined by a computer OS? (choose three answers)…

    • 957 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    CHAPTER3 REVEIW

    • 527 Words
    • 3 Pages

    6. A user has opened a word processor, typed the numbers 123456789, and stored the document as a file called report1. Which of the following determine, in part, what bits the computer stores in the file to represent the text typed into the report?…

    • 527 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    |File – Is a place where data is stored on a computer, there are many different types of files and most if not all data is stored in a file. |…

    • 829 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Nt1310 Unit 3 Assignment

    • 256 Words
    • 2 Pages

    Write a program to read the name of 5 students through keyboard and store them in a file “name.txt”.…

    • 256 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    POS 420 Week 4 DQs

    • 549 Words
    • 4 Pages

    Complete the University of Phoenix Material: File Processing Commands Worksheet located on your student website.…

    • 549 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    POS 420 Entire Course

    • 583 Words
    • 4 Pages

    Complete the University of Phoenix Material: File Processing Commands Worksheet located on your student website.…

    • 583 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    It210 Appendix F

    • 372 Words
    • 3 Pages

    1. The program will present a series of user screens that prompts the user for specified input.…

    • 372 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    POS 420 Week 5 UNIX Paper

    • 541 Words
    • 4 Pages

    Complete the University of Phoenix Material: File Processing Commands Worksheet located on your student website.…

    • 541 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    1) After the external file is loaded the user must develop the section of the program that displays the ten five- letter words.…

    • 553 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Nt1310 Unit 7 Week 7

    • 594 Words
    • 3 Pages

    The information that was posted gave in your assignment said that you have learned skills the following program data session programming structure named as…

    • 594 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    •Name and describe the only language that computers understand and explain how the instructions that people write for computers get into that form…

    • 322 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    what ever

    • 1175 Words
    • 5 Pages

    Be sure your output file contains user prompts and what was entered by the user .in addition to the results of your program processing. Run with above listed data. The instructor will give you additional data to test.…

    • 1175 Words
    • 5 Pages
    Powerful Essays
  • Satisfactory Essays

    Corporate Reporting

    • 1569 Words
    • 7 Pages

    Please complete all of the following details and then make this sheet the first page of each file of your assignment…

    • 1569 Words
    • 7 Pages
    Satisfactory Essays
  • Satisfactory Essays

    When a program starts in an object-oriented language, information is put into compartments. This is what allows the program to compute things. In this example, we’ll be taking an e-business and examining an order has been placed within said program. All of the data is put into the right compartments, but what happens when the order needs to be submitted? The program has to have the capability of taking the data from the compartments and saving it to a file that can be stored and accessed.…

    • 253 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    All About Visual Basic

    • 1703 Words
    • 7 Pages

    d. Testing the program and running it. Visual Basic has powerful debugging tools for this purpose.…

    • 1703 Words
    • 7 Pages
    Powerful Essays

Related Topics