Starting Out with C++: Early Objects
Starting Out with C++: Early Objects
8th Edition
ISBN: 9780133360929
Author: Tony Gaddis, Judy Walters, Godfrey Muganda
Publisher: Addison-Wesley
bartleby

Concept explainers

Question
Book Icon
Chapter 15, Problem 4PC
Program Plan Intro

Flexible Encryption

Program Plan:

  • Include the required header files to the program.
  • Define “Encryption” class.
    • In public, create a constructor, destructor and pure virtual function.
    • In protected, declare the required variable.
  • Define the constructor.
    • Open the input file and output file.
    • If the input file is not present, exit the program.
    • If the output file is not present, exit the program.
  • Define the destructor.
    • Close the input and output file.
  • Define the subclass “encrypt” function.
    • Declare the required variables.
    • Read the input file and write the encrypted form to the output file.
  • Define the “Encryption” function.
    • In public, define the “transform” function.
      • Return the encrypted value.
  • Define the “main()” function.
    • Declare the required variables.
    • Get the input and output file name from the user.
    • Create the objects for the classes.
    • Get the encryption key from the user.
    • Call the function “setKey” function with the key value.

Blurred answer
Students have asked these similar questions
Write a class Employee with data members Name, Id, and Salary. Derive two classes, Faculty with data members Department, and role(permanent or visiting) and derived class Management with data members Department and rank (manager, deputymanager, etc.). Create getters,settersfor all thedata members, create constructors,destructors and show functions for all the classes.Create a write function to write employees on a file . In main function create two objects of each derived class using parameterized constructors, call the show function to show all four objects, write all four objects to a file. Your submission should include the output file.
1. Implement a Student class. a. Create a class Student with the following private data members: 1. name 2. exam_1 grade 3. exam_2 grade b. Create all appropriate accessor and mutator functions. c. Assign appropriate access modifiers to insure encapsulation. d. Add a private calcGPA() function that calculates and returns the GPA based upon the two exam grades. e. Add a public getGrade() function that: 1. Obtains the GPA from the private calcGPA() function. 2. Returns a letter grade based upon the numerical GPA value. 90 to 100 = A 80 to 90 = B 70 to 80 = C 60 to 70 = D 0 to 60 = F f. Test all functions from main. 2. Using the class from problem 1, replace main with the following: a. Implement a partially filled array of type Student named students of capacity 10. b. Implement a non-member addStudent() function that: 1. Creates a new student with data populated by input parameters. 2. Adds the new student to the students array. c. Implement a non-member output() function that: 1.…
1. Implement a Student class. a. Create a class Student with the following private data members: 1. name 2. exam_1 grade 3. exam_2 grade b. Create all appropriate accessor and mutator functions. c. Assign appropriate access modifiers to insure encapsulation. d. Add a private calcGPA() function that calculates and returns the GPA based upon the two exam grades. e. Add a public getGrade() function that: 1. Obtains the GPA from the private calcGPA() function. 2. Returns a letter grade based upon the numerical GPA value. 90 to 100 = A 80 to 90 = B 70 to 80 = C 60 to 70 = D 0 to 60 = F f. Test all functions from main. 2. Using the class from problem 1, replace main with the following: a. Implement a partially filled array of type Student named students of capacity 10. b. Implement a non-member addStudent() function that: 1. Creates a new student with data populated by input parameters. 2. Adds the new student to the students array. c. Implement a non-member output() function that: 1.…

Chapter 15 Solutions

Starting Out with C++: Early Objects

Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education