Starting Out with C++ from Control Structures to Objects (9th Edition)
9th Edition
ISBN: 9780134498379
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 11, Problem 2PC
Movie Profit
Modify the program written for
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Consider the following structure:
struct student
{
int id;
char name[50];
float cgpa;
}list[10];
a) Write a function that finds the average cgpa. The function should display the student ids, names and cgpas of the students holding the cgpa less than the average cgpa.
b) Write a function to display all the student names with their cgpa
A shop sells a range of mobile devices, SIM cards and accessories as shown in the table (see attached)
Write a program algorithm for this shop:
Task 1 – Setting up the system:
Write a program to: Use appropriate data structures to store the item code, description and price information for the mobile devices, SIM cards and accessories; Allow the customer to choose a specific phone or tablet; Allow phone customers to choose whether the phone will be SIM; Free or Pay As You Go; Allow the customer to choose a standard or luxury case; Allow the customer to choose the chargers required (none, one or both may be purchased); Calculate the total price of this transaction; Output a list of the items purchased and the total price.
Task 2 – Allow a customer to order multiple mobile devices:
Offer the customer the opportunity to purchase an additional mobile device; if required, perform bulleted steps 2 to 7 of Task 1 for each additional mobile device and calculate a running total for…
Lab Activity 8: Functions
Objectives: The objective of this Lab Assignment is to use functions.
As you have learned already, the best approach to solve a problem is to break it down into individual
steps. Do not forget about what you have previously learned and seen. This assignment will be asking
you to use the knowledge you have acquired since the beginning of the semester.
PART 1: Percentage of amino acid residues.
Write a function that takes two arguments-a protein sequence and an amino acid residue code - and
returns the percentage of the protein that the amino acid makes up.
Test your function on the following examples:
Sequence
MSRSLLLRFLLFLLLLPPLP
MSRSLLLRFLLFLLLLPPLP
maralllrfllfllllpplp
MSRSLLLRFLLFLLLLPPLP
Amino acid residue
M
R
L
Y
Chapter 11 Solutions
Starting Out with C++ from Control Structures to Objects (9th Edition)
Ch. 11.4 - Prob. 11.1CPCh. 11.4 - Write a definition statement for a variable of the...Ch. 11.4 - Prob. 11.3CPCh. 11.6 - For Questions 11.4-11.7 below, assume the Product...Ch. 11.6 - Write a loop that will step through the entire...Ch. 11.6 - Prob. 11.6CPCh. 11.6 - Prob. 11.7CPCh. 11.6 - Write a structure declaration named Measurement,...Ch. 11.6 - Write a structure declaration named Destination,...Ch. 11.6 - Write statements that store the following data in...
Ch. 11.10 - Prob. 11.11CPCh. 11.10 - Write a function that uses a Rectangle structure...Ch. 11.10 - Prob. 11.13CPCh. 11.10 - Prob. 11.14CPCh. 11.10 - Prob. 11.15CPCh. 11.11 - Look at the following declaration: enum Flower {...Ch. 11.11 - What will the following code display? enum {...Ch. 11.11 - Prob. 11.18CPCh. 11.11 - What will the following code display? enum Letters...Ch. 11.11 - Prob. 11.20CPCh. 11.11 - Prob. 11.21CPCh. 11 - Prob. 1RQECh. 11 - Prob. 2RQECh. 11 - Prob. 3RQECh. 11 - Look at the following structure declaration:...Ch. 11 - Look at the following structure declaration:...Ch. 11 - Look at the following code: struct PartData {...Ch. 11 - Look at the following code: struct Town { string...Ch. 11 - Look at the following code: structure Rectangle {...Ch. 11 - Prob. 9RQECh. 11 - Look at the following declaration: enum Person {...Ch. 11 - Prob. 11RQECh. 11 - The ______ is the name of the structure type.Ch. 11 - The variables declared inside a structure...Ch. 11 - A(n) ________ is required after the closing brace...Ch. 11 - In the definition of a structure variable, the...Ch. 11 - Prob. 16RQECh. 11 - Prob. 17RQECh. 11 - Prob. 18RQECh. 11 - Prob. 19RQECh. 11 - Prob. 20RQECh. 11 - Declare a structure named TempScale, with the...Ch. 11 - Write statements that will store the following...Ch. 11 - Write a function called showReading. It should...Ch. 11 - Write a function called findReading. It should use...Ch. 11 - Write a function called getReading, which returns...Ch. 11 - Prob. 26RQECh. 11 - Prob. 27RQECh. 11 - Look at the following statement: enum Color { RED,...Ch. 11 - A per store sells dogs, cats, birds, and hamsters....Ch. 11 - T F A semicolon is required after the closing...Ch. 11 - T F A structure declaration does not define a...Ch. 11 - T F The contents of a structure variable can be...Ch. 11 - T F Structure variables may not be initialized.Ch. 11 - Prob. 34RQECh. 11 - Prob. 35RQECh. 11 - T F The following expression refers to element 5...Ch. 11 - T F An array of structures may be initialized.Ch. 11 - Prob. 38RQECh. 11 - T F A structure member variable may be passed to a...Ch. 11 - T F An entire structure may not be passed to a...Ch. 11 - T F A function may return a structure.Ch. 11 - T F when a function returns a structure, it is...Ch. 11 - T F The indirection operator has higher precedence...Ch. 11 - Prob. 44RQECh. 11 - Find the Errors Each of the following...Ch. 11 - Prob. 46RQECh. 11 - struct TwoVals { int a, b; }; int main () {...Ch. 11 - #include iostream using namespace std; struct...Ch. 11 - #include iostream #include string using namespace...Ch. 11 - struct FourVals { int a, b, c, d; }; int main () {...Ch. 11 - Prob. 51RQECh. 11 - struct ThreeVals { int a, b, c; }; int main () {...Ch. 11 - Prob. 1PCCh. 11 - Movie Profit Modify the program written for...Ch. 11 - Prob. 3PCCh. 11 - Weather Statistics Write a program that uses a...Ch. 11 - Weather Statistics Modification Modify the program...Ch. 11 - Soccer Scores Write a program that stores the...Ch. 11 - Customer Accounts Write a program that uses a...Ch. 11 - Search Function for Customer Accounts Program Add...Ch. 11 - Speakers Bureau Write a program that keeps track...Ch. 11 - Prob. 10PCCh. 11 - Prob. 11PCCh. 11 - Course Grade Write a program that uses a structure...Ch. 11 - Drink Machine Simulator Write a program that...Ch. 11 - Inventory Bins Write a program that simulates...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
// Superclass public class Vehicle { private double cost; public Vehicle (double c) { cost = c; } (Other method...
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
A large assembly jig for an airplane-wing component gave difficulty when it rested on four-point support. The a...
Degarmo's Materials And Processes In Manufacturing
Palindrome Testing A palindrome is a string that reads the same backward as forward. For example, the words wor...
Starting Out with C++: Early Objects (9th Edition)
Big data Big data describes datasets with huge volumes that are beyond the ability of typical database manageme...
Management Information Systems: Managing The Digital Firm (16th 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
- Data Structures (Code in Python) Q) Create a data structure to store invoice. This data structure can hold M/S Name, Company Name, Contact Number, Date, List of items (with their quantity & unit price) and total amount of invoice. Your program should take name, cell number first and then take items with their quantity & Price from user and display proper invoice like below image.arrow_forwardineering Computer Engineering Q&A Library Function: Create a function which accepts patient id and display the patients name, date admitted. Sample output is: The patient name is Maryam, she got admitted on 12-Feb-2020 Function: Create a function which accepts patient id and display the patients name, date admitted. Sample output is: The patient name is Maryam, she got admitted on 12-Feb-2020 Question Function: Create a function which accepts patient id and display the patients name, date admitted. Sample output is: The patient name is Maryam, she got admitted on 12-Feb-2020 Procedure Write a Procedure that accepts patient id and display the patient id, name, test name and result. Package Create a package which contains the above created procedure in the specification. Create package body of the above given procedure. And finally call the procedure created above by passing the patient id then display the output as shown below: Sample output: Patient id is: P0232…arrow_forwardMP: Create a program using structures to compute for the final grade of a student with the following conditions; Prelim grade 30% Midterm grade 30% Finals grade 40% See screenshot below for your reference: Name: Juan Dela Cruz Prelim Grade: 89 Midterm Grade: 82 Finals Grade: 77 Student Name Final Grade : Juan Dela Cruz 82.10 Name: Bill Gates Prelim Grade: 77 Midterm Grade: 84 Finals Grade: 90 Student Name Final Grade : Bill Gates 84.30arrow_forward
- Like any other type, structures can be pointed to by its own type of pointers. * Nesting structures Function Returning Structure O Pointers to structures O Data structurearrow_forwardFormatting Customer Names Build a function that displays a customer's name and location if applicableSuppose that you are building a Customer Relationship Management (CRM) system, and you want to display a user record in the following format: John Smith (California). However, if you don't have a location in your system, you just want to see "John Smith." Create a format_customer() function that takes two required positional arguments, first_ name and last_name, and one optional keyword argument, location. It should return a string in the required format. Create the customer.py file. Define the format_customer() function. Open a Python shell (Or Jupyter Notebook) and import your format_customer() function. Try running a few examples. The calls should look like this: from customer import format_customerformat_customer('John', 'Smith', location='California') and the output should look like this: John Smith (California) In [ ]:arrow_forwardcomments appreciatedarrow_forward
- c++arrow_forwardPHP Write a reduce function Write a function reduce($arr, $func) that takes an array and a function as a parameter. The reduce function should apply the parameter function to each element of the array in succession to produce a single result. Note: the current result should always be the first parameter to the function and the next element of the array should always be the second parameter. You may not use the PHP function array_reduce in your solution. For example, the result of the following should be 10. function myMax($current, $new) { return $current < $new ? $new : $current; } $arr = array(10, 5, 3, 5, 1, 2, 5, 7, 4); print("Max: " . reduce($arr, 'myMax') .arrow_forwardPython No hand written and fast answer with explanationarrow_forward
- Topic name: data structures please solve quicklyarrow_forwardCreating C Program using struct pointerCreate a C PROGRAM USING STRUCT POINTER to store and access “id, name and percentage” for any number of students. Structure array is used in this program to store and display records for many students. It can store “n” number of students record by declaring structure variable as ‘struct student record[n]“, where n can be 3 or 10 etc. Determine the highest grade and number of student passed and failed.NOTE:Your source code must display any of the given sample output below.It means your source code should be flexible enough to meet any of the given sample output.Your source code output must be identical to any of the given sample output.It means you have to strictly follow what are the displayed text, labels, casing of characters in the sample output.Passing Grade is 70-100. Sample Outputs:arrow_forwardcomments appreciatedarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:CengageC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Introduction to Variables; Author: Neso Academy;https://www.youtube.com/watch?v=fO4FwJOShdc;License: Standard YouTube License, CC-BY