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
İn C language
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…
A for loop is commonly used to iterate over all elements of an array.A. True B. False
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
Write your own version of malloc and free, and compare its running time and space utilization to the version of...
Computer Systems: A Programmer's Perspective (3rd Edition)
How many parameters does the following constructor have, and what are their types?
public Book (String title, ...
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Derive a class RegularPay from PayCalculator, as described in the previous exercise. It should have a construct...
Java: An Introduction to Problem Solving and Programming (8th Edition)
Explain why software testing should always be an incremental, staged activity. Are programmers the best people ...
Software Engineering (10th Edition)
3.12 (Date Create a class called Date that includes three pieces Of information as data
members—a month (type ...
C++ How to Program (10th Edition)
Give an example of each of the following, other than those described in this chapter, and clearly explain why y...
Modern Database Management (12th 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
- Python in files , want to write series of random number to already made file each random number should be in range of 1 to 60 , and the application should ask user how many random number the file will holdarrow_forwardPYTHON CODINGarrow_forwardPython - Next Birthdate In this task, we will write a program that reads birthdate data from a given CSV file, and given the current date, determines which person's birthday will be celebrated next. Create a function with the following signature: nextBirthdate(filename, date) filename: parameter, which represents the CSV filename. date: parameter, which represents the current date. The function should open the CSV file, read the birthdate data, and determine which person's birthday will be celebrated next, given the current date. The name of the person should be returned. In other words, given a date, find the person whose birthday is next. Sample Run birthdates.csv Draven Brock, 01/21/1952 Easton Mclean, 09/02/1954 Destiny Pacheco, 10/10/1958 Ariella Wood, 12/20/1961 Keely Sanders, 08/03/1985 Bryan Sloan,04/06/1986 Shannon Brewer, 05/11/1986 Julianne Farrell,01/29/2000 Makhi Weeks, 03/20/2000 Lucian Fields, 08/02/2018 Function Call nextBirthdate("birthdates.csv", "01/01/2022") Output…arrow_forward
- The GTUC Company wants to produce a product orders report from its product orders file. Each record on the file contains the product number of the item ordered, the product description, the number of units ordered, the retail price per unit, the freight charges per unit, and the packaging costs per unit. Your algorithm is to read the product orders file, calculate the total amount due for each product ordered and print these details on the product orders report.The amount due for each product is calculated as the product of the number of units ordered and the retail price of the unit. A discount of 10% is allowed on the amount due for all orders over 100.00. The freight charges and packaging costs per unit must be added to this resulting value to determine the total amount due.arrow_forwardAssignment 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_forward
- Could you please help me I want this program in C languagearrow_forwardJAVA PPROGRAM Write a program that prompts the user to enter a file name, then opens the file in text mode and reads names. The file contains one name on each line. The program then compares each name with the name that is at the end of the file in a symmetrical position. For example if the file contains 10 names, the name #1 is compared with name #10, name #2 is compared with name #9, and so on. If you find matches you should print the name and the line numbers where the match was found. While entering the file name, the program should allow the user to type quit to exit the program. If the file with a given name does not exist, then display a message and allow the user to re-enter the file name. The file may contain up to 100 names. You can use an array or ArrayList object of your choosing, however you can only have one array or ArrayList. Input validation: a) If the file does not exist, then you should display a message "File 'somefile.txt' is not found." and allow the…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_forwardI want to read the numbers from random_number.txt and then display the number and display total of the number and the number of random number read from the file and the average of this numberarrow_forwardThe function file_first_chars in python takes one parameter, fname, the name of a text file, and returns a string made up of the first character from each line in the file. You may assume there are no blank lines in the file. Hint: Use a for loop to iterate over the lines of the file and accumulate the string of first characters. NOTE: Return the function, don't print For example: Test Result print(file_first_chars("wordlist1.txt")) hsaemarrow_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