For Assignment 5, you will design and write a program that covers the following topics: Functions, Vectors, Structures, and Classes. Functions & Passing Variables: Write a different function for each type of variable used. The functions should provide

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
  • For Assignment 5, you will design and write a program that covers the following topics:
    • Functions, Vectors, Structures, and Classes.
    • Functions & Passing Variables: Write a different function for each type of variable used. The functions should provide some sort of output through a cout or return value.
      • Normal variable:
        • Passing a variable by value to a paramater of a function.
        • Show that this only makes a copy of the variable passed to it.
      • Normal variable with a default value: 
        • Set a default value for a function parameter.
        • Show how the default value gets used.
      • Reference variable:
        • Passing a variable by reference to a parameter of a function.
        • Show how a reference variable can change the value of variable in main().
        • Show how the use of const can make a reference variable safer (think of it in terms of read/write).
      • Pointer variable:
        • Passing an address of a variable to a parameter of a function.
        • Show how a pointer can change the value of a variable in main().
        • Show the multiple ways that const can make a pointer variable safer (think of it in terms of read/write and address flexibilty).
  •      
    • Overloading Functions
      • Write a set of two to three overloading functions of the same name, but with different parameter data types (like int, double, string).
      • Show how each function can be called depending upon the data type of the input parameters
  • Create a structure that contains two variables of different data types (like int, double, string).
    • Create a vector of structure objects and show how it can be loaded with user input, and outputted using the special range loop
  • Create a class that contains two private variables of different data types (like int, double, string) and four public functions (two "setter" functions and two "getter" functions) that manipulate the private variables.
    • Make the "getter" functions safer with const.
    • Create a vector of class objects and show how it can be loaded with user input, and outputted using the special range loop.
  •  
Expert Solution
steps

Step by step

Solved in 2 steps with 7 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY