Problem Solving with C++ (9th Edition)
9th Edition
ISBN: 9780133591743
Author: Walter Savitch
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 5, Problem 3P
Write a
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Change each one of these questions to now work using a function.  decide what the name of the function of each should be, how many parameters are required and what value needs to be returned. You’re no longer required to solve the problem - try to re-manage your code to be a function.
Write a program that uses input to prompt a user for their name and then welcomes
them.
Enter your name: Chuck
Hello Chuck
Python code
Screenshot and output is must
#include
#include
#include
#include
using namespace std;
// four function declarations
int main()
{
int id nullptr;
string* name = nullptr;
int* score = nullptr;
char filename [20];
cout> filename;
int count = readDataFromFile(filename, &id, &name, &score);
cout << "count : " << count << endl;
printData(id, name, score, count);
int max;
findMax (score, &max, count);
printMaxList (id, name, score, count, max);
return 0;
Enter filename: student. txt
Students List
108927
101981
102888
100738
100892
102893
109189
107182
106627
102930
108992
109281
104244
105566
102871
107889
Alice 80
Paul 92
86
70
Ruth
89
John
91
Tammy
95
Jenny 72
Amy
95
77
71
Cindy
Robert
Brian
Hailey
Jake 88
69
95
Sandy
Chris
Angel 82
Sue 93
*** Max score : 95
Students with max score
109189
95
}
106627
95
// four function definitions (readDataFromFile, printData, findMax, printMaxList) 105566
Chris 95
Tammy
Amy
Chapter 5 Solutions
Problem Solving with C++ (9th Edition)
Ch. 5.1 - What is the output of the following program?...Ch. 5.1 - Are you required to have a return statement in a...Ch. 5.1 - Suppose you omitted the return statement in the...Ch. 5.1 - Prob. 4STECh. 5.1 - Prob. 5STECh. 5.1 - Is a call to a void function used as a statement...Ch. 5.2 - What is the output of the following program?...Ch. 5.2 - What would be the output of the program in Display...Ch. 5.2 - What would be the output of the program in Display...Ch. 5.2 - Prob. 10STE
Ch. 5.2 - Write a void function definition for a function...Ch. 5.2 - Prob. 12STECh. 5.3 - Prob. 13STECh. 5.3 - Prob. 14STECh. 5.3 - Rewrite the function declaration comment for the...Ch. 5.3 - Prob. 16STECh. 5.4 - Prob. 17STECh. 5.4 - Prob. 18STECh. 5.4 - Prob. 19STECh. 5.4 - Prob. 20STECh. 5.4 - Prob. 21STECh. 5.4 - Write a stub for the function whose function...Ch. 5.5 - Prob. 23STECh. 5.5 - Prob. 24STECh. 5.5 - Prob. 25STECh. 5 - Write a function that computes the average and...Ch. 5 - Write a program that reads in a length in feet and...Ch. 5 - Write a program like that of the previous exercise...Ch. 5 - (You should do the previous two Practice Programs...Ch. 5 - Write a program that reads in a weight in pounds...Ch. 5 - Write a program like that of the previous exercise...Ch. 5 - (You should do the previous two Practice Programs...Ch. 5 - (You need to do Practice Programs 4 and 7 before...Ch. 5 - The area of an arbitrary triangle can be computed...Ch. 5 - Write a program that converts from 24-hour...Ch. 5 - Write a program that requests the current time and...Ch. 5 - Modify your program for Programming Project 2 so...Ch. 5 - Write a program that tells what coins to give out...Ch. 5 - In cold weather, meteorologists report an index...Ch. 5 - Prob. 6PPCh. 5 - Write a program that inputs a date (for example,...Ch. 5 - Complete the previous Programming Project and...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
On your system, place the class Pet (Listing 6.1) into a package so that you can use the class in any Java prog...
Java: An Introduction to Problem Solving and Programming (8th Edition)
What are the advantages in implementing a language with a pure interpreter?
Concepts of Programming Languages (11th Edition)
What Visual Basic function would you use to get the current time from the system, without the date?
Starting Out With Visual Basic (8th Edition)
Describe the three types of anomalies that can arise in a table and the negative consequences of each.
Modern Database Management
How do you create a button with a text and a node? Can you apply all the methods for Labeled to Button?
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
(Sum a Sequence of Integers) Write a program that sums a sequence of integers. Assume that the first integer re...
C How to Program (8th 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
- 4. Be able to write a simple user defined function that you can call and use in another program with a simple formula and some plotting. (i.e. like the kinetic energy example or the other example done in class) Write both the program and the function and show that it works.arrow_forwardOver the years, people have created a few nicknames for me. One that sticks without me telling me to call me that name is "Denck." It works great with anyone whose name ends with an "er". We are going to create a function called "nickName" which takes in one parameter. This parameter stores the name you want to create the nickname for. If the name ends with an er, return the name with the er removed. If the name does not have an er then return the full name back to the program.arrow_forward*DONOT USE CHATGPT, please put comments so i can understand. It’s a C language program with algorithm.arrow_forward
- Python Programming ONLY. Please use simple code, and avoid using classes. Provide explanation as well. Thank you. Write a program that keeps track of running piggybank deposits. The program should receive input from a user that will enter the amount to deposit into the piggybank. Use a function, add, which takes an argument number from the user input and adds it to a global sum variable. After the 5th deposit, print out the running total thus far.arrow_forwardYou are given a list of tasks to complete, along with their prerequisites. Write a function to determine if it is possible to complete all tasks, and if so, what order they should be completed in.arrow_forwardDon't send me AI response and I don't need plagiarised answer. If I see plagiarism then I'll give you multiple times downvotes for sure.arrow_forward
- Help.arrow_forwardModify the below code according to what is asking you to do. Show your modified code in a picture, please.arrow_forwardChange this question to work using a function. decide what the name of the function of each should be, how many parameters are required and what value needs to be returned. You're no longer required to solve the problem - try to re-manage your code to be a function. Write a program that uses input to prompt a user for their name and then welcomes them. Enter your name: Chuck Hello Chuckarrow_forward
- 6. Write a program which reads string and rewrite it in alphabetical order. For example, the word STRING should be written as GINRST. 7. Write a program to replace a particular word by another word in a given string. For example the “PYTHON” should be replaced by “C” in the text “It is good to program in PYTHON language”. 8. Write a program that will find the maximum number from 3 float type numbers. You have to usethe function getMax which will take 3 pointer variables and return the maximum number.arrow_forwardPython questionarrow_forwardPython question please include all steps and screenshot of code. Also please provide a docstring, and comments throughout the code, and test the given examples below. Thanks. In written text small numbers are often written out, e.g. you'd write 'I have twobrothers and one sister', rather than 'I have 2 brothers and 1 sister'. In this problem youwill implement a function convertSmall() that takes as input a text (i.e., string) s andreturns the text s with small numbers (integers between 0 and 6) converted to their names.>>> convertSmall('I have 2 brothers and 1 sister')'I have two brothers and one sister'>>> convertSmall('I have 8 brothers and 5 sisters')'I have 8 brothers and five sisters'arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
What Are Data Types?; Author: Jabrils;https://www.youtube.com/watch?v=A37-3lflh8I;License: Standard YouTube License, CC-BY
Data Types; Author: CS50;https://www.youtube.com/watch?v=Fc9htmvVZ9U;License: Standard Youtube License