CIS 247C Entire Course

Published on June 2017 | Categories: Business/Law | Downloads: 60 | Comments: 0 | Views: 763
Download PDF   Embed   Report

CIS 247C Entire Course Click Link Below To Buy: http://hwcampus.com/shop/cis-247c-entire-course/ Or Visit www.hwcampus.com Contact Us: [email protected] CIS 247C Entire Course Object-Oriented Programming with Lab DeVry No Final Exam CIS 247C iLab Week 1-7 DeVry CIS 247C iLab Week 1 DeVry iLAB OVERVIEW Scenario and Summary This program creates the basic user interface code that can be used in the following week’s iLab assignments. The assignment will help you get started using the programming environment and some practice with coding. You will also be able to reuse much, if not all, of the code in later assignments. In this program, you will create the following methods: 1. DisplayApplicationInformation, which will provide the program user some basic information about the program. 2. DisplayDivider, which will provide a meaningful output separator between different sections of the program output. 3. GetInput, which is a generalized function that will prompt the user for a specific type of information, then return the string representation of the user input. 4. TerminateApplication, which provides a program termination message and then terminates the application. Using these methods, you will construct a program that prompts the user for the following: 1. your name, which will be a string data type; 2. your age, which will be an integer data type; 3. the gas mileage for your car, which will be a double data type; and 4. a display of the collected information. CIS 247C iLab Week 2 DeVry iLAB OVERVIEW Scenario and Summary We begin our investigation of object-oriented programming by creating an object-oriented program with a class called Employee. You will create two objects based on the Employee class, along with a class that contains the main method. The attributes, constructors, and methods for this class must satisfy the requirements in Steps 1 through 3. After you create the objects, you will prompt the user for information and then display it. We will want to ensure that this first class is well-constructed and tested since we will extend this class in Labs 3 through 6. CIS 247C iLab Week 3 DeVry iLAB OVERVIEW Scenario and Summary The objective of the lab is to take the UML Class diagram and enhance last week’s Employee class by making the following changes: 1. Create a static variable called numEmployees that holds an int and initialize it to zero. This will allow us to count all the Employee objects created in the main class. 2. Increment numEmployees in all of the constructors 3. Add overloaded versions of setDependents and setAnnualSalary that accept strings. This way, we will have two “set” methods for both dependents and annual salary; one that accepts a string, and one that accepts its default data type. CIS 247C iLab Week 4 DeVry iLAB OVERVIEW Scenario and Summary The objective of the lab is to modify the Employee class to demonstrate composition and a class interface. An employee typically has benefits, so we will make the following changes: 1. Create a Benefits class. 2. Integrate the Benefit class into the Employee class. 3. Create an iEmployee abstract class to guarantee that calculatePay is implemented in the Employee class. A tutorial on interfaces can be downloaded here. CIS 247C iLab Week 5 DeVry iLAB OVERVIEW Scenario and Summary The objective of the lab is to take the UML Class diagram and enhance last week’s Employee class by making the following changes: 1. Create a class called Salaried that is derived from Employee. 2. Create a class called Hourly that is also derived from Employee. 3. Override the base class calculatePay() method. 4. Override the displayEmployee() method. CIS 247C iLab Week 6 DeVry iLAB OVERVIEW Scenario and Summary We have two separate goals this week: 1. We are going to create an abstract Employee class and two pure virtual functions – calculatePay() and displayEmployee(). The abstract Employee class will prevent a programmer from creating an object based on Employee, however, a pointer can still be created. Objects based on Salaried and Hourly will be allowed. The pure virtual function calculatePay() in Employee will force the child classes to implement calculatePay(). The other pure virtual function displayEmployee() in Employee will force the child classes to implement displayEmployee(). 2. We are going to implement Polymorphism and dynamic binding in this iLab. CIS 247C iLab Week 7 DeVry iLAB OVERVIEW Scenario and Summary This week, we learn how to manage complexity by putting together a ready-built application that comprises a number of separate header and source files. Our job here will be to take these individual files and combine them into one standalone application. Although the process is quite a simple one, it will emphasize the advantage of modularity when writing code. It also shows how code can be reused between programmers and/or applications. CIS 247C Quiz Week 1-6 DeVry CIS 247C Quiz Week 1 DeVry (TCO 1) Which of the following would be a more appropriate choice for a method in a Fork class? Color() Bend() Eat() Material() (TCO 1) By default, a class does not have the property of _____. Encapsulating data Information hiding Containing both data members and member methods Knowing how other classes are implemented (TCO 1) Which of the following statements is/are true? 1. A class is necessary to be defined before you can create an object. 2. The specific values of the attributes of an object represent the state of the object. 3. An interface of a class defines what messages an object can respond to. 4. Objects communicate through message passing. All are true Only A, B, and D are true None are true (TCO 1) _____ is the process of identifying important attributes and behaviors of an object. Class Abstraction Coding All of the above None of the above (TCO 1) Which of the following would be a more appropriate choice for a data member in a TextBox class? Resize Show Font Color Write (TCO 1) Examine the ClockType class definition. How many class members does it contain? class ClockType { public: void setTime(int, int, int); int getTime(); void printTime(); void icrementSeconds(); private: int hr; int min; int sec; } 7 3 10 4 An average of 5 because (7+3)/2=5 (TCO 8) Most professional coding standards use _____ for class and method names. Underscores along with all upper case words Method Class case No specific naming convention Pascal case (TCO 1) Inheritance is referred to as a(n) _____ relationship, while composition is referred to as a(n) _____ relationship. Superclass-subclass; friend Is-a; Has-a Has-a; Is-a None of the above (TCO 1) Assume we have two classes and have instantiated two objects from each class. How many copies of each class’s attributes and methods exist in the instantiated objects? Two copies, one copy of the first class and one of the second; objects always share attributes and methods Zero, the objects do not have attributes and methods Four copies, two copies of the first class and two of the second Eight copies (TCO 1) By default, all members of a class are _____. Public Private Protected Internal Unfriendly CIS 247C Quiz Week 2 DeVry (TCO 2) Getters and setters are sometimes called _____ methods and _____ methods, respectively. mutator; accessor accessor; mutator retrieval; putter None of the above (TCO 2) Only those class members that are presented to the users of the class are part of the ______ of the class. Interface Implementation Constructors Superclass (TCO 2) A Waiter is responsible for taking the order from the Customer, informing the Chef of the order and delivering the requested food back to the Customer. A Chef is responsible for preparing the food and notifying the Waiter when the food is ready. The Customer is responsible for placing an order from the menu. In identifying the interface of the Chef object, which of the following would you consider as (an) appropriate message(s) the Chef should respond to? “Take a pound of ground meat, add a chopped onion, salt, pepper, parsley and broil for 15 minutes until the burger becomes golden brown.” “What do you do after work?” “Prepare a steak, medium-rare.” All of the above Only A and C (TCO 2) Which of the following statements is/are false? If a method is public, it is considered part of the class interface. One goal regarding the implementation of a class should be kept in mind: a change to the implementation should not require a change to the user’s code. If you declare an attribute as public, you do not have to worry about tracking down every piece of code that might have changed the attribute when debugging. All of the above None of the above (TCO 5) One of the purposes of a(n) _____ is to release resources back to the system when the object is not used anymore. Class Constructor Destructor Instance variable (TCO 5) Consider the following class definition. class Flower { private: string color; double cost; public: Flower() { color = “red”; cost = 0.0; } Flower(string c) { color = c; cost = 0.0; } void setColor(string c) { color = c; } void setCost(int amount) { cost = amount; } } Which of the following is/are true? (i) The attribute cost can be set to a new value, by a user of this class (ii) You can write cout

Comments

Content

CIS 247C Entire Course Click Link Below To Buy: http://hwcampus.com/shop/cis-247c-entire-course/ Or Visit www.hwcampus.com Contact Us: [email protected] CIS 247C Entire Course Object-Oriented Programming with Lab DeVry No Final Exam CIS 247C iLab Week 1-7 DeVry CIS 247C iLab Week 1 DeVry iLAB OVERVIEW Scenario and Summary This program creates the basic user interface code that can be used in the following week’s iLab assignments. The assignment will help you get started using the programming environment and some practice with coding. You will also be able to reuse much, if not all, of the code in later assignments. In this program, you will create the following methods: 1. DisplayApplicationInformation, which will provide the program user some basic information about the program. 2. DisplayDivider, which will provide a meaningful output separator between different sections of the program output. 3. GetInput, which is a generalized function that will prompt the user for a specific type of information, then return the string representation of the user input. 4. TerminateApplication, which provides a program termination message and then terminates the application. Using these methods, you will construct a program that prompts the user for the following: 1. your name, which will be a string data type; 2. your age, which will be an integer data type; 3. the gas mileage for your car, which will be a double data type; and 4. a display of the collected information. CIS 247C iLab Week 2 DeVry iLAB OVERVIEW Scenario and Summary We begin our investigation of object-oriented programming by creating an object-oriented program with a class called Employee. You will create two objects based on the Employee class, along with a class that contains the main method. The attributes, constructors, and methods for this class must satisfy the requirements in Steps 1 through 3. After you create the objects, you will prompt the user for information and then display it. We will want to ensure that this first class is well-constructed and tested since we will extend this class in Labs 3 through 6. CIS 247C iLab Week 3 DeVry iLAB OVERVIEW Scenario and Summary The objective of the lab is to take the UML Class diagram and enhance last week’s Employee class by making the following changes: 1. Create a static variable called numEmployees that holds an int and initialize it to zero. This will allow us to count all the Employee objects created in the main class. 2. Increment numEmployees in all of the constructors 3. Add overloaded versions of setDependents and setAnnualSalary that accept strings. This way, we will have two “set” methods for both dependents and annual salary; one that accepts a string, and one that accepts its default data type. CIS 247C iLab Week 4 DeVry iLAB OVERVIEW Scenario and Summary The objective of the lab is to modify the Employee class to demonstrate composition and a class interface. An employee typically has benefits, so we will make the following changes: 1. Create a Benefits class. 2. Integrate the Benefit class into the Employee class. 3. Create an iEmployee abstract class to guarantee that calculatePay is implemented in the Employee class. A tutorial on interfaces can be downloaded here. CIS 247C iLab Week 5 DeVry iLAB OVERVIEW Scenario and Summary The objective of the lab is to take the UML Class diagram and enhance last week’s Employee class by making the following changes: 1. Create a class called Salaried that is derived from Employee. 2. Create a class called Hourly that is also derived from Employee. 3. Override the base class calculatePay() method. 4. Override the displayEmployee() method. CIS 247C iLab Week 6 DeVry iLAB OVERVIEW Scenario and Summary We have two separate goals this week: 1. We are going to create an abstract Employee class and two pure virtual functions – calculatePay() and displayEmployee(). The abstract Employee class will prevent a programmer from creating an object based on Employee, however, a pointer can still be created. Objects based on Salaried and Hourly will be allowed. The pure virtual function calculatePay() in Employee will force the child classes to implement calculatePay(). The other pure virtual function displayEmployee() in Employee will force the child classes to implement displayEmployee(). 2. We are going to implement Polymorphism and dynamic binding in this iLab. CIS 247C iLab Week 7 DeVry iLAB OVERVIEW Scenario and Summary This week, we learn how to manage complexity by putting together a ready-built application that comprises a number of separate header and source files. Our job here will be to take these individual files and combine them into one standalone application. Although the process is quite a simple one, it will emphasize the advantage of modularity when writing code. It also shows how code can be reused between programmers and/or applications. CIS 247C Quiz Week 1-6 DeVry CIS 247C Quiz Week 1 DeVry (TCO 1) Which of the following would be a more appropriate choice for a method in a Fork class? Color() Bend() Eat() Material() (TCO 1) By default, a class does not have the property of _____. Encapsulating data Information hiding Containing both data members and member methods Knowing how other classes are implemented (TCO 1) Which of the following statements is/are true? 1. A class is necessary to be defined before you can create an object. 2. The specific values of the attributes of an object represent the state of the object. 3. An interface of a class defines what messages an object can respond to. 4. Objects communicate through message passing. All are true Only A, B, and D are true None are true (TCO 1) _____ is the process of identifying important attributes and behaviors of an object. Class Abstraction Coding All of the above None of the above (TCO 1) Which of the following would be a more appropriate choice for a data member in a TextBox class? Resize Show Font Color Write (TCO 1) Examine the ClockType class definition. How many class members does it contain? class ClockType { public: void setTime(int, int, int); int getTime(); void printTime(); void icrementSeconds(); private: int hr; int min; int sec; } 7 3 10 4 An average of 5 because (7+3)/2=5 (TCO 8) Most professional coding standards use _____ for class and method names. Underscores along with all upper case words Method Class case No specific naming convention Pascal case (TCO 1) Inheritance is referred to as a(n) _____ relationship, while composition is referred to as a(n) _____ relationship. Superclass-subclass; friend Is-a; Has-a Has-a; Is-a None of the above (TCO 1) Assume we have two classes and have instantiated two objects from each class. How many copies of each class’s attributes and methods exist in the instantiated objects? Two copies, one copy of the first class and one of the second; objects always share attributes and methods Zero, the objects do not have attributes and methods Four copies, two copies of the first class and two of the second Eight copies (TCO 1) By default, all members of a class are _____. Public Private Protected Internal Unfriendly CIS 247C Quiz Week 2 DeVry (TCO 2) Getters and setters are sometimes called _____ methods and _____ methods, respectively. mutator; accessor accessor; mutator retrieval; putter None of the above (TCO 2) Only those class members that are presented to the users of the class are part of the ______ of the class. Interface Implementation Constructors Superclass (TCO 2) A Waiter is responsible for taking the order from the Customer, informing the Chef of the order and delivering the requested food back to the Customer. A Chef is responsible for preparing the food and notifying the Waiter when the food is ready. The Customer is responsible for placing an order from the menu. In identifying the interface of the Chef object, which of the following would you consider as (an) appropriate message(s) the Chef should respond to? “Take a pound of ground meat, add a chopped onion, salt, pepper, parsley and broil for 15 minutes until the burger becomes golden brown.” “What do you do after work?” “Prepare a steak, medium-rare.” All of the above Only A and C (TCO 2) Which of the following statements is/are false? If a method is public, it is considered part of the class interface. One goal regarding the implementation of a class should be kept in mind: a change to the implementation should not require a change to the user’s code. If you declare an attribute as public, you do not have to worry about tracking down every piece of code that might have changed the attribute when debugging. All of the above None of the above (TCO 5) One of the purposes of a(n) _____ is to release resources back to the system when the object is not used anymore. Class Constructor Destructor Instance variable (TCO 5) Consider the following class definition. class Flower { private: string color; double cost; public: Flower() { color = “red”; cost = 0.0; } Flower(string c) { color = c; cost = 0.0; } void setColor(string c) { color = c; } void setCost(int amount) { cost = amount; } } Which of the following is/are true? (i) The attribute cost can be set to a new value, by a user of this class (ii) You can write cout

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close