STARTING OUT WITH PROGRAMMING LOGIC+DE
18th Edition
ISBN: 9781323826256
Author: 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
Question 1: Write a C function that declares a student structure that contains his name, his first name and his student number.
Question 2: Write a C function that initializes the cell by taking the 3 parameters from the keyboard.
Question 3: Write a function that displays the contents of the cell passed as a parameter.
(a)(i) Create an Employee structure that will have the following members: name (string type), phoneNo (string type), and a salary (float type).
(ii) In the main function, create an array of size N of Employee structure type. This array will be used by all the functions. You will pass this array and # of employees as arguments to the functions.
(b) Create a function “takeEmployeesInfoFromKeyboard” that takes an Employee structure array and the size of the array as parameters. It takes information of all the Employees from keyboard and stores in the Employee structure array. Do you know that arrays are passed by reference?
(c) Create a function “searchAnEmployee” that takes an Employee structure array, a phone number, and the size of the array as parameters. It finds and displays the employee’s information from the array searching by the phone number.
(d) Create a function “displayAllEmployeesInfoReverse” that takes an Employee structure array and the size of the array as parameters. It…
Define a struct type that represents an exercise plan. The struct should store the following data: plan name (a character array of size 50) and goal calories to burn (an integer). The type should be renamed from struct exercise_plan to Exercise_plan.
Chapter 11 Solutions
STARTING OUT WITH PROGRAMMING LOGIC+DE
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
The size, shape, color and weight of an object are considered of the objects class.
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Open the Chap3\ Error2\ Error2 project from the student sample programs folder. The application has an error. F...
Starting Out With Visual Basic (8th Edition)
What are the four basic arithmetic operations?
Digital Fundamentals (11th Edition)
Describe a method that can be used to gather a piece of data such as the users age.
Web Development and Design Foundations with HTML5 (8th Edition)
Write a program to print the corresponding Celsius to Fahrenheit table.
C Programming Language
Assuming that intNumber is an integer variable, what value will each of the following statements assign to it? ...
Starting Out With Visual Basic (7th 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
- Please fill in the blanks for C /* This function works with pointers and structures. All codes will be in main(). Define a struct time with 3 fields: hours, minutes, and seconds (all ints) in that order. */ /* Pointers and Structures*/ #include<stdio.h> //Define a structure of type struct time struct time { __1__ hours; __2__ minutes; __3__ seconds; }; int main() { //Declare 2 struct of type struct time called t1 and t2 __4__ __5__ t1, t2; //Declare a pointer-to-struct called pt of the same type __6__ __7__ __8__; //Initialize the pointer point to t1 __9__ = __10__; //Assign values to each member. No space!! //1. using t1 variable __11__ = 3; //hours __12__ = 15; //minutes __13__ = 59; //seconds //2. Using de-referecing pointer pt and period. Remember the () __14__ = 3;…arrow_forward(Card Shuffling and Dealing) Modify the program you developed in Exercise 17.23 so thatit deals a five-card poker hand. Then write functions to accomplish each of the following:a) Determine whether the hand contains a pair.b) Determine whether the hand contains two pairs.c) Determine whether the hand contains three of a kind (e.g., three jacks).d) Determine whether the hand contains four of a kind (e.g., four aces).e) Determine whether the hand contains a flush (i.e., all five cards of the same suit).f) Determine whether the hand contains a straight (i.e., five cards of consecutive facevalues)arrow_forwardNested function classwork 2 Write 'taxIncome', a user-defined function that calculates income tax. y = taxIncome (income) defines the principal function. The main function calculates adjusted income as income - 6000. Then y = computeTax is called. For y = 0.28*AdjustedIncome, this function uses 'AdjustedIncome'. 'AdjustedIncome' was defined in the main function. Use $80,000 income.arrow_forward
- (a)(i) Create a City structure that will have the following members: name (string type), population (int type), and averageTemperature (float type). (ii) In the main function, create an array of size N of City structure type. This array will be used by all the functions. You will pass this array and # of cities as arguments to the functions. (b) Create a function “takeCitiesInfoFromKeyboard” that takes a City structure array and the size of the array as parameters. It takes information of all the Cities from keyboard and stores in the City structure array. Do you know that arrays are passed by reference? (c) Create a function “findCityWithHighestTemperature” that takes a City structure array and the size of the array as parameters. It finds and displays the city’s information that has the highest temperature. (d) Create a function “displayAllCitiesInfo” that takes a City structure array and the size of the array as parameters. It displays those Cities’ information whose temperatures…arrow_forwarda)(i) Create a City structure that will have the following members: name (string type), population (int type), and averageTemperature (float type). (ii) In the main function, create an array of size N of City structure type. This array will be used by all the functions. You will pass this array and # of cities as arguments to the functions. (b) Create a function “takeCitiesInfoFromKeyboard” that takes a City structure array and the size of the array as parameters. It takes information of all the Cities from keyboard and stores in the City structure array. Do you know that arrays are passed by reference? (c) Create a function “findCityWithHighestTemperature” that takes a City structure array and the size of the array as parameters. It finds and displays the city’s information that has the highest temperature. (d) Create a function “displayAllCitiesInfo” that takes a City structure array and the size of the array as parameters. It displays those Cities’ information whose temperatures are…arrow_forward(Modifying Class GradeBook) Modify class GradeBook (Figs. 16.11–16.12) as follows:a) Include a second string data member that represents the course instructor’s name.b) Provide a set function to change the instructor’s name and a get function to retrieve it.c) Modify the constructor to specify course name and instructor name parameters.d) Modify function displayMessage to output the welcome message and course name,then the string "This course is presented by: " followed by the instructor’s name.Use your modified class in a test program that demonstrates the class’s new capabilities.arrow_forward
- Structures, like any other type, may have their own set of pointers. Structures that nest Returning Structure from a Function Structures' pointers Structure of the dataarrow_forward3. Create 3 structures student, marks and university.Student should have name semester and grade.University should have student as its member and 1 more member need to be adress.Cin all the values and display them on screen. You can use member function of structure or you can directly display them by accessing separately.arrow_forwardReturn type_________________ indicates that a function will perform a task but will not returnany information when it completes its task.arrow_forward
- 4. pet_shopping_list For the purposes of this question, if you have a pet of a certain type, that pet needs food, treats, a bed and a house -- but multiple animals of the same kind can share. This function takes what kind of animal or animals you have and returns a shopping list for your pet or pets. PLAN FOR THIS FUNCTION: determine the word for a single kind of the animal. if the input is "mice", then we want the output to contain "mouse" (don't worry about any other unusual plurals). Otherwise, look for words that end with "es" and remove the final "es", so "foxes" goes to "fox". Otherwise, remove a final "s". Otherwise, assume that the word is singular. build and return a shopping list, which will be a list of strings. shopping lists should be in the shape: ["mouse food", "mouse treats", "mouse bed", "mouse house"] Sample calls should look like: >>> pet_shopping_list("mice")['mouse food', 'mouse treats', 'mouse bed', 'mouse house']>>>…arrow_forwardSetup We will work with books. A book for this program is defined as a structure that has a book id, a title, and an author. For simplicity, you may assume that the author and the title are character arrays of size 50, and that the id is an int data type. Part 1 Write a C program, named part1.c, that defines the book structure and implements the createBook and printBook functions. It is up to you to define the appropriate prototype for these functions, that is the arguments, argument data types and return values that you deem appropriate. In the main function, the program should create and print the following books The Da Vinci Code, by Dan Brown Twilight, by Stephanie Meyer To Kill a Mockingbird, by Harper Lee The Godfather, by Mario Puzo Little Women, by Louisa May Alcott Part 2 Write a C program named, part2.c, to include the implementation of a list of books and implements (at least) two functions insertBook and printList. You are responsible to choose the…arrow_forwardSetup We will work with books. A book for this program is defined as a structure that has a book id, a title, and an author. For simplicity, you may assume that the author and the title are character arrays of size 50, and that the id is an int data type. Part 1 Write a C program, named part1.c, that defines the book structure and implements the createBook and printBook functions. It is up to you to define the appropriate prototype for these functions, that is the arguments, argument data types and return values that you deem appropriate. In the main function, the program should create and print the following books The Da Vinci Code, by Dan Brown Twilight, by Stephanie Meyer To Kill a Mockingbird, by Harper Lee The Godfather, by Mario Puzo Little Women, by Louisa May Alcott Part 2 ---- Use Linked Lists Write a C program named, part2.c, to include the implementation of a list of books and implements (at least) two functions insertBook and printList. You are…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
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