Starting Out with C++ from Control Structures to Objects (9th Edition)
Starting Out with C++ from Control Structures to Objects (9th Edition)
9th Edition
ISBN: 9780134498379
Author: Tony Gaddis
Publisher: PEARSON
Question
Book Icon
Chapter 11, Problem 10PC
Program Plan Intro

Speaker’s Bureau

Program Plan:

  • Include the required header files.
  • Declare the constant variable “n” as type of integer.
  • Declare a structure named “Speaker”.
    • Declare the members “s_name”, “number”, “spe_top”, and “req_fee”.
  • Declare a function named “inp_data()” to get input data.
  • Declare a function named “disp_data()” to display all data.
  • Declare a function named “key_search()” to search for a speaker on a particular topic.
  • Define the “main()” function.
    • Declare the variables “ms”, “option”, and “spe_num” as integer type.
      • Declare the structure array variable “arr[]” with size “n”.
      • Use “do-while” loop to display the menu.
        • Get the “option” from user and validate the option using “while” loop.
        • Use “switch-case” to perform the action chosen by the user from the menu.
  • Define the “inp_data()”  function to get speaker name, telephone number, speaking topic and fee required from the user.
    • Validate each input which are empty or less than “0”.
  • Define a function “disp_data” to display the content of the structure array.
  • Define a “key_search()” function.
    • Declare the temporary variable “temp” in Boolean data type.
      • Perform the necessary operation to search the speaker name to the array of structures.

Blurred answer
Students have asked these similar questions
Effects on Size and PaddingA flexible array member is treated as having no size when calculating the size of a structure, though paddingbetween that member and the previous member of the structure may still exist:/* Prints "8,8" on my machine, so there is no padding. */printf("%zu,%zu\n", sizeof(size_t), sizeof(struct ex1));/* Also prints "8,8" on my machine, so there is no padding in the ex2 structure itself. */printf("%zu,%zu\n", sizeof(struct ex2_header), sizeof(struct ex2));/* Prints "5,8" on my machine, so there are 3 bytes of padding. */printf("%zu,%zu\n", sizeof(int) + sizeof(char), sizeof(struct ex3));The flexible array member is considered to have an incomplete array type, so its size cannot be calculated usingsizeof.
(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…
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 are…

Chapter 11 Solutions

Starting Out with C++ from Control Structures to Objects (9th Edition)

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...
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT