Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
5th Edition
ISBN: 9780134801155
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 10, Problem 5AW
Modify the
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
This program asks the user to enter 4 names for a team,
storing them in an array of Strings.
Then the program asks for one of those names again,
and a new name to substitute instead of that one.
Finally, the program changes the array, making that
substitution. This modified list of names is printed
on the screen. You can see sample output at the end of this file.
The Apgar Medical group keeps a patient file for each doctor in the office. Each record contains the patient's first and last name, home address, and birth year. The records are sorted in ascending birth year order. Write a program so that display a count of the number of patients born each year
John Hanson, 23 Elm, 1927Mary Locust, 476 Maple, 1950Susan Monroe, 512 Peachtree, 1957Carol Fortune, 2819 Locust, 1960James Fortune, 2819 Locust, 1963Lawrence Fish, 12 Elm, 1968Janice Weiss, 234 Birch, 1971Henry Garza, 199 Second, 1973Kimberly Swanson, 310 Appletree, 1980Louis Claude, 2716 Third, 1981Jill Fox, 12 Oak, 1985Opal Reynolds, 78 County Line, 1987Francis Dumas, 67 Fourth, 1992Madison Conroy, 23 Fifth, 1996Daniel Moy, 100 Sunset, 1987
The average amount Sold function is not run as expect. Please fix it.
The input file: sales.txt
header in picture. It is over 5000 char. I can't copy.
13492785 2017 Jane North; 1000 78534520 2012 Tim South; 95020192756 2017 Linda East; 15000 19273458 2012 Paul West; 500078520192 2017 Mary Jane Doe; 5001 32278520 2012 Victor Smith; 799514278520 2012 Mary Johnson; 12056192785 2017 Tom Baker; 1300 88278529 2012 Diana Newman; 150089278527 2012 William Peterson; 1420098278528 2012 Jim Gaddis; 120099192785 2017 Laura King; 1000 43278524 2012 Ann McDonald; 2000
The output expect: in picture.
#include "Sales.h"#include <iostream>#include <sstream>#include <iomanip>#include <fstream>#include <string>using namespace std;
const int MAX_SIZE = 30;
void readData(string fileName, Sales salesArr[], int n);double calcSalesAvg(Sales salesArr[], int n);void displayOverAvg(Sales salesArr[], int n, double avg);void writeReport(Sales salesArr[], int n, string…
Chapter 10 Solutions
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Ch. 10.1 - Where are files normally stored?Ch. 10.1 - What is an output file?Ch. 10.1 - What is an input file?Ch. 10.1 - What three steps must be taken by a program when...Ch. 10.1 - Prob. 10.5CPCh. 10.1 - Prob. 10.6CPCh. 10.1 - When writing a program that performs an operation...Ch. 10.1 - In most programming languages, if a file already...Ch. 10.1 - What is the purpose of opening a file?Ch. 10.1 - What is the purpose of closing a file?
Ch. 10.1 - Prob. 10.11CPCh. 10.1 - Prob. 10.12CPCh. 10.1 - What is a files read position? Initially, where is...Ch. 10.1 - In what mode do you open a file if you want to...Ch. 10.2 - Prob. 10.15CPCh. 10.2 - What is the purpose of the eof function?Ch. 10.2 - Is it acceptable for a program to attempt to read...Ch. 10.2 - Prob. 10.18CPCh. 10.2 - Which of the following loops would you use to read...Ch. 10.4 - Prob. 10.20CPCh. 10.4 - Prob. 10.21CPCh. 10.4 - Prob. 10.22CPCh. 10 - A file that data is written to is known as a(n) a....Ch. 10 - A file that data is read from is known as a(n) a....Ch. 10 - Before a file can be used by a program, it must be...Ch. 10 - When a program is finished using a file, it should...Ch. 10 - The contents of this type of file can be viewed in...Ch. 10 - This type of file contains data that has not been...Ch. 10 - When working with this type of file, you access...Ch. 10 - When working with this type of file, you can jump...Ch. 10 - This is a small holding section in memory that...Ch. 10 - Prob. 10MCCh. 10 - This is a character or set of characters that...Ch. 10 - This marks the location of the next item that will...Ch. 10 - When a file is opened in this mode, data will be...Ch. 10 - The expression NOT eof (myFi1e) is equivalent to...Ch. 10 - This is a single piece of data within a record. a....Ch. 10 - When working with a sequential access file, you...Ch. 10 - In most languages, when you open an output file...Ch. 10 - The process of opening a file is only necessary...Ch. 10 - Prob. 4TFCh. 10 - Prob. 5TFCh. 10 - When a file that already exists is opened in...Ch. 10 - In control break logic, the program performs some...Ch. 10 - Describe the three steps that must be taken when a...Ch. 10 - Why should a program close a file when its...Ch. 10 - What is a files read position? Where is the read...Ch. 10 - If an existing file is opened in append mode, what...Ch. 10 - In most languages, if a file does not exist and a...Ch. 10 - What is the purpose of the eof function that was...Ch. 10 - What is control break logic?Ch. 10 - Design a program that opens an output file with...Ch. 10 - Design a program that opens the my_name.dat file...Ch. 10 - Prob. 3AWCh. 10 - Design an algorithm that does the following: opens...Ch. 10 - Modify the algorithm that you designed in question...Ch. 10 - Write pseudocode that opens an output file with...Ch. 10 - Prob. 7AWCh. 10 - A file exists on the disk named students.dat. The...Ch. 10 - Why doesn't the following pseudocode module work...Ch. 10 - File Display Assume that a file containing a...Ch. 10 - Item Counter Assume that a file containing a...Ch. 10 - Sum of Numbers Assume that a file containing a...Ch. 10 - Average of Numbers Assume that a file containing a...Ch. 10 - Largest Number Assume that a file containing a...Ch. 10 - Golf Scores The Springfork Amateur Golf Club has a...Ch. 10 - Sales Report Brewster's Used Cars, Inc. employs...Ch. 10 - Lowest and Highest Gas Prices Assume that you have...Ch. 10 - Average Steps Taken A Personal Fitness Tracker is...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Give an example of each of the following, other than those described in this chapter, and clearly explain why y...
Modern Database Management
What is the meaning of (int) that appears in the definition of the method getPopulationIn10 in Listing 5.3, and...
Java: An Introduction to Problem Solving and Programming (8th Edition)
Write two statements that use a file stream object named places to open a file named places.dat. (Show how to o...
Starting Out with C++ from Control Structures to Objects (9th Edition)
public class MyClass { private int x; private double y; public static void setValues(int a, double b) { x = a; ...
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
A file that contains a Flash animation uses the __________ file extension. a. .class b. .swf c. .mp3 d. .flash
Web Development and Design Foundations with HTML5 (8th Edition)
The wires each have a diameter of 12 in., length of 2 ft, and are made from 304 stainless steel. If P = 6 kip, ...
Mechanics of Materials (10th Edition)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Assignment 5A: Multiple Frequencies. In the last assignment, we calculated the frequency of a coin flip. This required us to have two separate variables, which we used to record the number of heads and tails. Now that we know about arrays, we can track the frequency of all numbers in a randomly generated sequence. For this program, you will ask the user to provide a range of values (from 1 to that number, inclusive) and how long of a number sequence you want to generate using that number range. You will then generate and save the sequence in an array. After that, you will count the number of times each number occurs in the sequence, and print the frequency of each number. Hints: You can use multiple arrays for this assignment. One array should hold the number sequence, and another could keep track of the frequencies of each number. Sample Output #1: What's the highest number you want to generate?: 5 How Long of a number sequence do you want to generate?: 10 Okay, we'll generate 10…arrow_forwardNote: Please use WHILE LOOP and print all the contents of the array. Use java language. Days of the Week. Create an array of Strings which are initialized to the 7 daysof the week. Use while-loop and print all the contents of the array.arrow_forwardcreate an INDEXCEPTION value of the unique vowels and unique consonants that the name that was given to you can create. Use python processStep 1: For every unique vowel of a name, you need to get the first index of that vowel from the original string.Step 2: For each vowel index you get from step 1, you will get the unique consonant from that position. if the index is out of scope of the consonant array, ignore that vowel index.Step 3: For each unique consonant that you get from step 2, you need to get the first index of that consonant from the original string.Step 4: Get the value of indexception by adding all index you get from step 3.outputTO BE DISPLAYED- 2 lists that consists of unique vowels and unique consonants- The vowel, the vowel index, the consonant, the consonant indexFINAL OUTPUT- The total indexception value of the name that was given to you.arrow_forward
- The following numbers are inserted into an empty LLRBT in the given order: 11, 2, 14, 25, 15, 13, 16. Please draw the resulting LLRBT.arrow_forward$aprintarrow_forwardProgramming language: C/C++, Java, Python, or any other advanced programming languages Project Description: the file “IntegerArray.txt” included in this project folder contains all the 100,000 integers between 1 and 100,000 (inclusive) in some order, with no integer repeated. Your task is to compute the number of inversions in the file given, where the i-th row of the file indicates the i-th entry of an array. Because of the large size of this array, you should implement a divide-and-conquer algorithm.arrow_forward
- This program needs 3 parts Read in this attached inputFile.txt (75 50 60 80 90) from a file into your Grade array. Use a bubble sort to sort the array (Print to console each pass of the array until the array is sorted.) Write out to console the low score the high score and the average scorearrow_forwardIn order to achieve the best run time performance the coder needs to know if arrays are stored in columns or in rows. True Falsearrow_forwardHow to accept input from the following labels and storing them in arraysarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
C - File I/O; Author: Tutorials Point (India) Ltd.;https://www.youtube.com/watch?v=cEfuwpbGi1k;License: Standard YouTube License, CC-BY
file handling functions in c | fprintf, fscanf, fread, fwrite |; Author: Education 4u;https://www.youtube.com/watch?v=aqeXS1bJihA;License: Standard Youtube License