Create a program named paintingdemo

Assignment Help C/C++ Programming
Reference no: EM133201514

This Assignment Description contains three programming assignments. Below are the programming assignments from the concepts learnt. Each assignment has a problem description, and you are required to discussion, to be complete / to solve the problem. 

Programming Assignment 1

Write a program named SalespersonDemo that instantiates objects using classes named RealEstateSalesperson and GirlScout. Demonstrate that each object can use a SalesSpeech() method appropriately. Also, use a MakeSale() method two or three times with each object, and display the final contents of each object's data fields. First, create an abstract class named Salesperson. Fields include first and last names; the Salesperson constructor requires both these values. Include properties for the fields. Include a method that returns a string that holds the Salesperson's full name-the first and last names separated by a space. Then perform the following tasks:

  • Create two child classes of Salesperson: RealEstateSalesperson and GirlScout. The RealEstateSalesperson class contains fields for total value sold in dollars and total commission earned (both of which are initialized to 0), and a commission rate field required by the class constructor. The GirlScout class includes a field to hold the number of boxes of cookies sold, which is initialized to 0. Include properties for every field.
  • Create an interface named ISellable that contains two methods: SalesSpeech() and MakeSale(). In each RealEstateSalesperson and GirlScout class, implement SalesSpeech() to display an appropriate one- or two-sentence sales speech that the objects of the class could use.

 In the RealEstateSalesperson class, implement the MakeSale() method to accept an integer dollar value for a house, add the value to the RealEstateSalesperson's total value sold, and compute the total commission earned. In the GirlScout class, implement the MakeSale() method to accept an integer representing the number of boxes of cookies sold and add it to the total field.        

Programming Assignment 2

Create a program named PaintingDemo that instantiates an array of eight Room objects and demonstrates the Room methods. The Room constructor requires parameters for length, width, and height fields; use a variety of values when constructing the objects. The Room class also contains a field for wall area of the Room and number of gallons of paint needed to paint the room. Both of these values are computed by calling private methods. Include read-only properties to get a Room's values. A room is assumed to have four walls, and you do not need to allow for windows and doors, and you do not need to allow for painting the ceiling. A room requires one gallon of paint for every 350 square feet (plus an extra gallon for any square feet greater than 350). In other words, a 12 X 10 room with 9-foot ceilings has 396 square feet of wall space, and so requires two gallons of paint.

Programming Assignment 3

Remember, strings are immutable. Consider a string that represents a strand of DNA: string dna = " TCG-TAC-gaC-TAC-CGT-CAG-ACT-TAa-CcA-GTC-cAt-AGA-GCT". There are some typos in the string that we would like to fix:

  1. Use the Trim() method to remove the leading and trailing whitespace, and then print the results.
  2. Change all of the letters in the dna string to UPPERCASE and print the result.
  3. Note that if you try Console.WriteLine(dna) after applying the methods, the original, flawed string is displayed. To fix this, you need to reassign the changes back to dna. Apply these fixes to your code so that Console.WriteLine(dna) prints the DNA strand in UPPERCASE with no whitespace.

Let's use string methods to do more work on the DNA strand:

  1. Replace the sequence "GCT" with 'AGG', and then print the altered strand.
  2. Look for the sequence "CAT" with IndexOf(). If found print, "CAT found", otherwise print, "CAT NOT found".
  3. Use Substring() to print out the fifth set of 3 characters (called a codon) from the DNA strand.
  4. Use string interpolation to print, "The DNA strand is ___ characters long.

If we want to turn the string "C Sharp" into "CS", we might try .Remove(). Too easy. Let's use our cleverness to achieve the same result and practice with other C# methods.

  1. Use string concatenation and two Substring() methods to print "CS" from "C Sharp".
  2. Without using Substring(), use method chaining to accomplish the same thing.
  3. Use bracket notation and string interpolation to print, "The abbreviation for "C Sharp" is "CS." Don't forget about your escape characters.

Reference no: EM133201514

Questions Cloud

Dispute over the profits arises, and ultimately a court : LAW 100 Strayer University and How could this dispute have been avoided in the first place - What will be the result?
Define health behavior explain public health significance : Define the health behavior explain the public health significance of the health behavior (e.g., prevalence, population, morbidity, mortality)
What are the main ways to segment markets : What are the main ways to segment markets? Doing it internationally can be difficult. What are the things you need to keep in mind when doing so?
Should be tackled with break-even analysis : Explain why pricing and production are extent decisions and not decisions that should be tackled with break-even analysis.
Create a program named paintingdemo : This Assignment Description contains three programming assignments. Below are the programming assignments from the concepts learnt. Each assignment has a proble
What autotrophs need for photosynthesis : Moraine Valley Community College-By now you should know what our cells need for cellular respiration and what autotrophs need for photosynthesis.
Which a firm made a decision considering irrelevant costs : Explain a situation you have observed (or read about) in which a firm made a decision considering irrelevant costs.
Evolutionary Taxonomy and Cladistic Taxonomy : BIO 120-Grossmont College-What is taxonomy? Think about whether mosses have vascular tissue or not.
What was the most challenging aspect of the project : What was the most challenging aspect of the project? What will you do differently next time? What did you understand that you not know before completing project

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd