Question
Welcome to 189! This homework covers the topics from 175 that are most important for 189. If you had trouble with pointers and dynamic memory
Welcome to 189! This homework covers the topics from 175 that are most important for 189. If you had trouble with pointers and dynamic memory (or didn't get to them where you took 175) then this is the week to get caught up. If you didn't even get to objects though, you are in a little more of a pickle. 175 and 153 should both get to objects. Bust out your old textbook and bring it to office hours and I'll try to catch you up.
For this, you are going to need some classes. Grill, Hotdog, and Person. The goal is to show how two different objects can both do something to the same other object.
- Create those classes
- Create a local Grill variable in main
- Dynamically create a Hotdog and a Person
- Give Grill a method that takes a hotdog pointer and sets a cooked flag in the hotdog to true
- Give Person a method that takes a hotdog pointer and outputs that flag
- Make main call those two methods
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started