The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 313 Weeks Ago, 5 Days Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
Hello,
I need help with my homework. This is a Programming Logic (C#) I would appreciate any help
IT 1050 – Programming Logic
Final Exam – Take Home Portion
32 Points
1. (3 points) Explain inheritance in your own words. Give an example of two classes that could be used to demonstrate inheritance (you do not need to write the code). Why do we use inheritance?
2. (3 points) Explain polymorphism in your own words. Explain an example (you do not need to write code).
3. (2 points) Write a loop that outputs i * 3 for i =10 to i = 4000.
4. (3 points) Write a loop that outputs i / 2 for i =12345 to i> 1234. Decrement by 300 each time through the loop.
5. (3 points) Write an if…else-if….else statement that outputs the following for each given input:
Input Output
1 Math
2 Composition
3 History
4 Information Technology
6. (3 points) Re-write problem 5 using a switch statement.
7. (4 points) Write an if…else-if statement that outputs the following for each given input. Use boolean operators to create compound conditions.
Input Output
C# or VB Oracle
Android SDK Google
iOS or XCode Apple
Java and RedHat Oracle
Java Sun Microsystems
8. (3 points) Create an array that stores the following string values: spicy, salty, bland, greasy, delicious. Use a foreach loop to output all of the values.
9. (8 points) Create a class for a Television
Add the following encapsulated properties (use Get and Set):
bool isOn
intcurrentChannel
string currentInput
Add the following methods:
public void turnOn() – set isOn to true and display “TV is on”
public void turnOff() – set isOn to false and display “TV is off”
public void setChannel (int channel) – if the TV is on, set currentChannel to channel. Display “Current channel is set to “ + currentChannel
public void getInput() – return the value of currentInput
public void setInput(intnewInput) – set the value of currentInput to newInput
Create an instance of the TV class and demonstrate all of the methods.
----------- ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly