Problem Solving with C++ (10th Edition)
10th Edition
ISBN: 9780134448282
Author: Walter Savitch, Kenrick Mock
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 7, Problem 14PP
Redo (or do for the first time)
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Assignment
A scientist has developed a mathematical model for a physical process, and he wants to check how
good is model is. To evaluate the correctness of his model, he wants to test the results of his model
under certain parameters and compare them with experimental results.
Write a program that first reads the number of tests (testCount) as an int followed by the results of
each test according to the model as a double array (testModel) and finally the results of each test
according to experiments as a double array (testExperiment). Then, the program should calculate
the error of the model by evaluating the average of the absolute values (i.e., mutlak değer) of the
differences between the model result and experimental result (see formula below) using a function.
ItestModel,- textExperiment,
testCount
NOTE: Individual absolute value of the difference between the model value and the experiment value
calculations MUST be done in the function. Every other functionality MUST be done in…
Assignment
A scientist has developed a mathematical model for a physical process, and he wants to check how good is model is. To evaluate the correctness of
his model, he wants to test the results of his model under certain parameters and compare them with experimental results.
Write a program that first reads the number of tests (testCount) as an int followed by the results of each test according to the model as a double
array (testModel) and finally the results of each test according to experiments as a double array (testExperiment). Then, the program should
calculate the error of the model by evaluating the average of the ratio of absolute values (i.e., mutlak değer) of the differences between the model
result and experimental result to the model result (see formula below) using a function.
testCount testModel, - textExperiment,
testModel,
Error=
Input
testCount
NOTE: Individual ratio of absolute value of the difference between the model value and the experiment value to the model…
In this assignment, you will decide how to keep the inventory in the text file. Then your program must read the inventory from the file into the array.
Each product must have a record in the file with the name, regular price, and type. There are several options for storing records in the file. For example,
• each value takes one line in the file (i.e., three lines for one product). Then you must take care of correct handling of the ends of the lines;
• all values are in one line that can be read as a string. Then you must handle the parsing of the string;
• all values are in one line separated by a delimiter. Then you must handle a line with delimiters.
Assume that the inventory does not have more than 100 products. But the actual number is known only after the reading of the file. Once you can read data from the file into the array, you must add a new property to the product class – a static variable that holds the number of products in the inventory. Its value must grow as reading…
Chapter 7 Solutions
Problem Solving with C++ (10th Edition)
Ch. 7.1 - Prob. 1STECh. 7.1 - In the array declaration double score(5); state...Ch. 7.1 - Identity any errors in the following array...Ch. 7.1 - What is the output of the following code? char...Ch. 7.1 - What is the output of the following code? double a...Ch. 7.1 - What is the output of the following code? int i,...Ch. 7.1 - Prob. 7STECh. 7.1 - Suppose we expect the elements of the array a to...Ch. 7.1 - Prob. 9STECh. 7.1 - Suppose you have the following array declaration...
Ch. 7.2 - Consider the following function definition: void...Ch. 7.2 - Prob. 12STECh. 7.2 - Write a function definition for a function called...Ch. 7.2 - Consider the following function definition: void...Ch. 7.2 - Insert const before any of the following array...Ch. 7.2 - Write a function named outOfOrder that takes as...Ch. 7.3 - Write a program that will read up to ten...Ch. 7.3 - Write a program that will read up to ten letters...Ch. 7.3 - Following is the declaration for an alternative...Ch. 7.4 - Prob. 20STECh. 7.4 - Write code that will fill the array a (declared...Ch. 7.4 - Prob. 22STECh. 7 - Write a function named firstLast2 that takes as...Ch. 7 - Write a function named countNum2s that takes as...Ch. 7 - Write a function named swapFrontBack that takes as...Ch. 7 - The following code creates a small phone book. An...Ch. 7 - There are three versions of this project. Version...Ch. 7 - Hexadecimal numerals are integers written in base...Ch. 7 - Solution to Programming Project 7.3 Write a...Ch. 7 - Prob. 4PPCh. 7 - Write a program that reads in a list of integers...Ch. 7 - Prob. 6PPCh. 7 - An array can be used to store large integers one...Ch. 7 - Write a program that will read a line of text and...Ch. 7 - Write a program to score five-card poker hands...Ch. 7 - Write a program that will allow two users to play...Ch. 7 - Write a program to assign passengers seats in an...Ch. 7 - Prob. 12PPCh. 7 - The mathematician John Horton Conway invented the...Ch. 7 - Redo (or do for the first time) Programming...Ch. 7 - Redo (or do for the first time) Programming...Ch. 7 - A common memory matching game played by young...Ch. 7 - Your swim school has two swimming instructors,...Ch. 7 - Your swim school has two swimming instructors,...Ch. 7 - Prob. 19PPCh. 7 - The Social Security Administration maintains an...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
For each of the following activities, give a PEAS description of the task environment and characterize it in te...
Artificial Intelligence: A Modern Approach
Write a function called s to extract a portion of a character string. The function should be called as follows:...
Programming in C
Consider the adage Never ask a question for which you do not want the answer. a. Is following that adage ethica...
Experiencing MIS
Given that y=ax3+7, which of the following are correct Java statements for this equations? int y = a x (x x +...
Java How To Program (Early Objects)
isMember Method Write a recursive boolean method named isMember. The method should search an array for a specif...
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Implement a method, empty, that simulates the effect of removing all money from the machine. This method should...
Objects First with Java: A Practical Introduction Using BlueJ (6th 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
- In a C++ program, you need to store the ID's and GPS's for 25 students. 1. Define 2 arrays that may be used in parallel to store the ID's and GPS's. 2. Write a loop to print the ID and GPA arrays in columns, with column headings. Put the information for each student on its own line.arrow_forwardPlease, write a program:arrow_forwardIn C language pleasearrow_forward
- Exercise 2: We are tasked to write a program that shows some information about 12 persons: first name, last name and telephone number. To do this, we have to create 3 arrays and fill them by the information wanted (first name, last name, phone number) respectively. In order to do some changes on this information, we can create a counter to specify the index of the information we want to change or to update; each index is referred to the each one of the people that we need to save their information.arrow_forwarddo in javaarrow_forwardQ2. You are the class representative and your class advisor always requests your help to prepare the result analysis after each internal assessment. One of the tasks that your class advisor has assigned to you is to find whether a student has scored a 0 in a course.Given the scores of the 'n' students in the class, write a python program to find whether how many students have scored a zero in a course. Use arrays to store the marks of the students and assume that the maximum number of students in a class is 50.oarrow_forward
- Code in java pleasearrow_forwardWrite a program that takes 20 elements of array from user at run time. And also Find maximum element of array and swap it with last element of array. Display before and after swapping array.arrow_forwardMake a program in JavaIn this simulation there are 7 countries competing { Mexico, Canada, China, Japan, Spain, Australia, Italy}2.There are three types of dents {Gold, Silver, Bronze}3.Use constant values for array dimensions4.Country names and medal types should be stored in an array.5.Randomly assign values between 1 and 10 that represent the number of medals of the corresponding type that the corresponding country has won.6.Show a table that represents the information of the medal table. Table must include country header names and medal type7.Show the total number of medals that each country obtained8.Show the name of the country that got the most medals, no matter the type of medal.9.Show the name of the country that obtained the most Gold medalsarrow_forward
- JAVA Your teacher has created two arrays, each holding the results of tests, say Test 1 and Test 2. You need to create a new array which holds the averages of these two tests. You may assume that the first element of the first test array refers to the student who also has the grade in the first element of the second test, and the last element in each array are the grades the last student earned for each test. All students received grades for both tests, meaning both test arrays are of the same length. Complete the method, named makeAverage, in the class named Grades.java. There are two parameters to this method: the first is the integer array representing the grades of the first test, and the second is the array containing the grades of the second test. The new average array should be returned by the method. The grades should be treated as double variables. For example, consider the test grades for the five students in the following arrays: [ 87 ] [ 91 ] [ 76 ] [ 76 ] [ 94 ]…arrow_forward2. A store owner wants the total sales for 2020. Write a program that will load an array with 12 months of sales. Use iomanip to make a nice-looking chart that shows the monthly sales, the month with the highest sales, lowest sales, and average for the year sales. January ……………. $50,000 February…………… $60,000 March ……………….$80,000 April ………………..$106,000 May …………………..$50,000 June ………………..$190,000 July ………………….$900,000 August …………… $102,000 September ………..$70,000 October …………..$700,000 November………… $90,000 December …………$90,000 Total Sales for the year 2020 was ………………….………$ The month with highest sales was ****** at ………..$ The month with lowest sales was ****** at ………...$ The average of sales for the year was ……………………$ C++arrow_forward2. Write a program to create a 2-D array of size 3 X 3. The user enters the data. Then, display the data of the array. This is just to make sure you understand 2-D arrays. Sum the columns of the array. Print this out. Sum the rows of the array. Print that out. Find the highest number in the array. Make sure Java standards and good formatting are followed.arrow_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
Definition of Array; Author: Neso Academy;https://www.youtube.com/watch?v=55l-aZ7_F24;License: Standard Youtube License