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.4, Problem 11.2CP
Write a definition statement for a variable of the structure you declared in Question 11.1. Initialize the members with the following data:
Account Number: ACZ42137-B12-7
Account Balance: $4512.59
Interest Rate: 4%
Average Monthly Balance: $4217.07
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
use c code to develop a program In this program you will create a structure called class to hold the information of a class in Seneca college’s buildings. The information required for each class is as follows
Campus name (like newham or Seneca@york)
Building name (like Victor Phillip Dahdaleh Building)
floor (like 1 2 3 4 5, …)
class code (like DB2109)
size of class (40 60 25)
has projector (yes/no)
has podium (yes/no)
has whiteboard (yes/no)
The following is the declaration of the structure
Struct class{
Char campus[101];
Char building[101];
---
---
}
Complete the above structure template based on the list of attributes provided
Implement the followinggetClass function that receives a pointer to a vehicle and fills it up with user data. No user input validation is necessary. The user should be properly prompted for each field. Be careful with proper usage of . (dot) operator and -> (arrow) operator as this is the part of the code that gets the mark!
void getClass…
write an expression that can be used to access the structure members in each of the following parts: d) Member firstName of the structure pointed to by customerPtr.
Q 1: A company named ABC hired three employees in different years; each employee
gets an increment of 5000 yearly. Also each employee gets bonus amount of 10k for
each project he has done yearly. The programs should have following attributes that
should be entered by the user according to their need in specific parts:
Employee name
Served years
No of projects done per year
Initial salary
Declare a structure for an employee, mention the attributes (name, no of years served,
salary), declare an array of structures for no of employees. Then declare three
functions, one should return a structure by value with no argument passed which will
take all attributes from the user and in second pass the structure by reference as an
argument to a function and it should display all the attributes of an employees and
then in third pass the structure by value as an argument to a function and it should
display current salary of employees.
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
Classify each of the following Vole instructions in terms of whether its execution changes the contents of the ...
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Define a class called Counter. An object of this class is used to count things, so it records a count that is a...
Java: An Introduction to Problem Solving and Programming (8th Edition)
Describe some design trade-offs between efficiency and safety in some language you know.
Concepts of Programming Languages (11th Edition)
Prime numbers can also be generated by an algorithm known as the Sieve of Eratosthenes. The algorithm for this ...
Programming in C
We can summarize the imperative programming paradigm by saying that it places emphasis on describing a process ...
Computer Science: An Overview (12th Edition)
Using examples, illustrate the different types of adaptor needed to support sequential composition, hierarchica...
Software Engineering (10th 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
- account.json "1000001": { "accountType": "Chequing", "accountBalance": 0 }, "1000002": { "accountType": "Savings", "accountBalance": 0 }, "1000011": { "accountType": "Chequing", "accountBalance": 0 }, "1000022": { "accountType": "Savings", "accountBalance": 0 }, "1000031": { "accountType": "Chequing", "accountBalance": 0 }, "1000032": { "accountType": "Savings", "accountBalance": 0 }, "1000051": { "accountType": "Chequing", "accountBalance": 13.699999999999989 }, "1000052": { "accountType": "Savings", "accountBalance": 0 }, "1000071": { "accountType": "Chequing", "accountBalance": 0 }, "1000081": { "accountType": "Savings", "accountBalance": 0 }, "1000091": { "accountType": "Chequing", "accountBalance": 0 }, "lastID": "1000091"} ------- var express =…arrow_forwardThe employee structure variable contains a member variable named decSalary. Which of the following increases the employee’s salary by 10%?a. employee.decSalary = employee.decSalary * .1b. employee.decSalary = employee.decSalary * 1.1c. employee.decSalary *= .1d. both a and carrow_forwardUse the following definitions to answer Questions P3 – P16:You have been asked to represent data for the list of courses offered in a given quarter and the students registered for each course. You should represent each course with the following namedtuple:Course = namedtuple (‘Course’, ‘name department students’) The Course name and department are strings. The Course students is a list of student objects. You should represent each student with the following namedtuple:Student = namedtuple(‘Student’, ‘name age gpa’)The Student name is a string, the age is an integer, and gpa is a float..s1 = Student("Joe", 18, 3.0)s2 = Student("Jane", 19, 3.2)s3 = Student("Pete", 20, 2.8)s4 = Student("Sally", 21, 2.9)s5 = Student("Matt", 22, 3.3)s6 = Student("Tina", 20, 3.4)c1 = Course("CS151", "CS", [s1, s2, s3, s4, s6])c2 = Course"CS152", "CS", [s1, s5, s3, s2])c3 = Course("Math2B", "Math", [s6, s5, s4])AllCourses = [c1, c2, c3] Q3:AllCourses[1].students[2].age Q4:len(c2.students) Q5:s1 in…arrow_forward
- Write a statement to print the data members of InventoryTag. End with newline. Ex: if itemID is 314 and quantityRemaining is 500, print:Inventory ID: 314, Qty: 500 #include <iostream>using namespace std; struct InventoryTag { int itemID; int quantityRemaining;}; int main() { InventoryTag redSweater; cin >> redSweater.itemID; cin >> redSweater.quantityRemaining; /* Your solution goes here */ return 0;}arrow_forward1.Write a definition statement that defines a Car structure variable initialized with the following data: Make: Ford Model: Mustang Year Model: 1968 Cost: $20,000. 2.Considering the structure in the previous question, Define an array of 25 of the Car structure variables.arrow_forwardselect the correct answer that describes the C++ statement Q/ apple . price = 100; Ans/ 1) compare 100 to the value of data member apple.price 2)multiply apple by price and make the result 100 3)set the value of apple data member in the structure object price to 100 4)set the value of price data member in the structure object apple to 100arrow_forward
- Given a structure for student as follows: struct student { int ID; float grade; } s[5]; Use scanf to have user enter ID and grades for each student: 1st student ID =1, Grade = 90 2nd student ID=2, Grade = 81.5 3rd student ID=3, Grade = 85.5 4th student ID=4, Grade = 88 5th student ID=5, Grade = 94 Each student as a structure needs to have the ID and grade properly set. Output: The average grade for 5 students' needs to be reported using printf. Also, each student ID and Grade need to be reported. NOTE: Use structure syntax as needed. Use for loop when you deal with arrays.arrow_forwardGiven the following code: match the data type with the variable. Some answer may be used more than once struct product Type int product Number: double cost: int numberInStock; }; int main (void) struct product Type toyCar; struct productType barbies [10]; struct product Type ploy stoyCar; ... the rest of the main is not shown &barbies[3] toycar.numberinStock pToy pToy-productNumber barbies ("pToy).cost toyCar cost مر barbies[0] 1. char 2. int 3. double: 4. array 5. productType 6. productType" 7. None listedarrow_forwardDeclare a structure named TempScale, with the following members:fahrenheit: a doublecelsius: a doubleNext, declare a structure named Reading, with the following members:windSpeed: an inthumidity: a doubletemperature: a TempScale structure variableNow, define a Reading structure variable named today.Finally, write statements that will store the following data in the Reading structure variable.Wind speed: 37 mphHumidity: 32%Fahrenheit temperature: 32 degreesCelsius temperature: 0 degreesarrow_forward
- Q3 OCaml type signature 1 Point The OCaml type signature val f : 'a -> a = indicates that function f has a parameter and return value that can be any type, as long as the types of f 's parameter and return value are the same. True False Q4 OCaml structured return values 1 Point OCaml, unlike most functional languages, does not allow functions to return structured values. True Falsearrow_forwardA structure variable named address contains a member variable named strStreet. Which of the following statements assigns the string “Maple” to the member variable?address.strStreet = “Maple”strStreet.address = “Maple”strStreet&address=”Maple”address&strStreet = “Maple”arrow_forwardC++ OOP Create a struct Rectangle where a rectangle is defined by Length & Width. Each Rectanglehas an area and perimeter. You can also compare two rectangles with respect to the area.o The program should be able to calculate the perimeter () and the area () of therectangle, can set the value of length and width and retrieve the value of length &width.2. Create a struct Student where attributes associated with each student are his name,registration number, father name, degree and department. One can view the details of allstudents and can also search the details of any student by name.3. Make a struct Cylinder. Choose appropriate attributes. Code should be able to calculate:o Surface Area of Cylinder (Formula A = 2πr^2 + 2πrh = 2πr(r + h))o Volume of cylinder (Formula V = πr^2h)4. You are going to make an employee management system. In this lab, you have to create anEmployee class only. Employee class fields are: Employee Name, Employee ID, andEmployee Gender. The member…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Structured Chart; Author: Tutorials Point (India) Ltd.;https://www.youtube.com/watch?v=vdUO-sGA1DA;License: Standard YouTube License, CC-BY
Introduction to Structure Charts; Author: Christopher Kalodikis;https://www.youtube.com/watch?v=QN2bjNplGlQ;License: Standard Youtube License