Write an C#application for Nina’s Cookie Emporium named CookieDemo that declares and demonstrates objects of the CookieOrder class and its descendants. The CookieOrder class includes the following auto-implemented properties: OrderNum - The order number Name - The recipient’s name CookieType - The cookie type (for example, chocolate chip) The class should also include fields for number of dozens ordered an
Q: You are implementing a console application in the context of your selected theme(Hotel Booking…
A: Solution:--Using visual studio I have written this code in C#. File1-Room.cs *Code:-- using…
Q: Write the application AutomobileDemo that prompts a user for data for eight Automobile objects. The…
A: program:- 1. AUTOMOBILE.CS
Q: Build the ItemToPurchase class with the following specifications: Attributes item_name (string)…
A: Let the instance variables in the class be public so that we can access them without using mutator…
Q: Write a C# application that implements a class ‘Employee’ with the following members. Six private…
A: Algorithm: Step1: Create a Employee Class. Declare the private members. Step2: Create the…
Q: 1. Create a public class named Monday. This class shall contain the main method. 2. Define an…
A: NOTE - I have used the Java programming language. Here I have created the interface named Alarm with…
Q: Suppose you have implemented a collection of asset subclasses in a manner similar to the stock…
A: The portfolio display method summarizes the portfolio contents (because this statement is not…
Q: Microsoft Visual C# 7th edition. Instruction: Write an application for Nina’s Cookie Emporium named…
A: using System;class CookieOrder{private int orderNo;private string reciepientName;private string…
Q: Create an application named RecoveringDemo that declares objects of three types: Patient,…
A: Introduction of the Program: Like a class, an interface can have data member and member functions…
Q: It is required to develop an application in Java to perform some operations to store information…
A: Please check the step 2 for solution
Q: in Java, 1. Write a class called Counter that has the following:- Data field counterIndex- Default…
A: Programming instructions: Create a class Counter. Create an int data member. Create a constructor…
Q: Write a C3# program that implements a class called MyToys. Your class should have the following data…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: use FractionDemo program as a Console Application that instantiates several Fraction objects and…
A: Code Image: Sample Output:
Q: Create an application in C# named TestClassifiedAd that instantiates and displays at least two…
A: Answer:- Here is the perfect solution for your requirement please follow it step by step code…
Q: Write the application AutomobileDemo that prompts a user for data for eight Automobile objects in C#…
A: Required C# code provided below :
Q: Question 1. Given the properties and default no-arg constructor for a SmartPhone class, write a…
A: This question belong to C#, only constructor and whole code is also attached and screenshot is also…
Q: For both classes, you must at least have a default constructor (switch...case...default)[This is…
A: Introduction of Program: In this program, a Home Class has a Square foot, a Number of Bedrooms, and…
Q: Referring to the UML class diagram given above, write codes in the main application that will do the…
A: Composition is a type of relationship between two or more classes. The composition indicates that…
Q: Write a program named DemoJobs for Harold’s Home Services. The program should instantiate several…
A: This programs defines a class named DemoJobs that insantiaties an array of three objects. The class…
Q: java programming Write a class named HiddenClass under apackage namedumbrella.HiddenClass contains…
A: We cannot create multiple packets in single java file so create two files MainClass.java:- package…
Q: (a) Use java to create a class named Student that includes data fields for the student ID, name, a…
A: Java is a programming language based on object oriented concepts. Everything in Java is associated…
Q: Java Object Oriented Programming Create a Shape class that shall have color and filled instance…
A: Answer in step2
Q: Write Rectangle class to represent a rectangle. The class contains: a. Two double data fields named…
A: public class Rectangle{ //instance variables private double width; private double height;…
Q: Consider a class named CustomData. Which choice is a correct declaration syntax to overload the…
A: The declaration syntax to overload the postfix operator is as follows: Class class_name {…
Q: Q7: Listed next is the skeleton for a class named InventoryItem. Each inventory item has a name and…
A: Answer: Program Plan: Create the class InventoryItem that contains a String and int as its instance…
Q: in netbeans Write a complete class named Crab that includes a String property named myColor and an…
A: This is an oops question in which we have to make a class named Crab that includes a String property…
Q: It is required to develop an application in Java to maintain information about students registered…
A: Program (A) // Course.java : Java code to create Course class public class Course { // attributes…
Q: Write a FractionDemo program as a Console Application that instantiates several Fraction objects and…
A: using System; public class FractionDemo { public static void Main() { Fraction…
Q: In Java Write a CashRegister class that can be used with the RetailItem class that you wrote in…
A: The complete code is given below.
Q: A class named CafeService contains • Two data members i.e. the orderID and the price of food item(s)…
A: Program Approach:- Declaring class name as cafe service. Putting orderID and price in the…
Q: Java Programming: Practice your class design and development process by creating 2 classes based on…
A: Program: Filename - "Address.java" public class Address { private String homeNumber; private…
Q: 1. Create a public class named Monday. This class shall contain the main method. 2. Define an…
A: Here is the solution with an output:-
Q: 1- Write a class declaration for Shape class and add the two variables to the class declaration…
A: public class Main{ public static void main(String[] args) { Shape s1=new Shape(4,4); //create…
Q: Write a program in java Write a class named Car that has the following fields: • yearModel. The…
A: Write the Car class with yearModel, make and speed fields. Add a constructor which takes a year and…
Q: Create a class named "YourLN"
A: 1. Create class YourLN 2. declare all data member given above 3. Create default and parameterized…
Q: It is required to develop an application in Java to perform some operations to store information…
A: Given:
Q: olymorphism c. inherit
A: When you redefine the __str__ method in a class, the keyword print has different meanings based on…
Q: Write a CashRegister class that can be used with the RetailItem class that you wrote in Chapter 6’s…
A: *************CashRegister.java***************** public class CashRegister { // These are…
Q: PLEASE DO IN JAVA (for programs like Eclipse) Create a UEmployee class that contains member…
A: Almost all the code is same . It is mentioned in the question that the type user should be provide…
Q: It is required to develop an application in Java to perform some operations to store information…
A: Program: abstract class Item{ String itemName; int itemNum; String make; double…
Q: Write an application for Nina’s Cookie Emporium named CookieDemo that declares and demonstrates…
A: Program Explanation: Include the header file. Create a class or function name cookieorder. Take the…
Q: rite an c# application for Nina’s Cookie Emporium named CookieDemo that declares and demonstrates…
A: the code is an given below :
Q: Sanchez Construction Loan Co. makes loans of up to R100,000 for construction projects. There are two…
A: the code for the above requirement is
Q: Write a C# application that implements a class 'Employee' with the following members. i. Six private…
A: Create an Employee instance Set the values Print all the values
Q: Write a program IN C# named SalespersonDemo that instantiates objects using classes named…
A: Answer :
Q: A programmer has submitted the following class declaration for approval. This will be part of a…
A: The given program is a java program and that program has some violation, which is listed below with…
Q: Write an application that uses an abstract Insurance class and Health and Life subclasses to display…
A: public abstract class Insurance{ protected String type; protected double cost; public…
Q: Write an application for Nina’s Cookie Emporium named CookieDemo that declares and demonstrates…
A: Answer: 1
Q: (In Java language) Create a class Called NetflixDemo Create two objects “user1” and “user2” of…
A: Here , we have given the java class named Netflix. We need to create the two objects of this class…
Q: Code a private method called gradeScale that takes in a parameter mark as a String. The mark should…
A: PROGRAM import java.util.Scanner;public class grade_cal{private static String gradeScale(String…
Q: a. Create a java class named RawMaterial. b. Add the following fields to the RawMaterial class. Note…
A: As our company guidelines we are supposed to answer only one question per post and kindly resubmit…
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Write an C#application for Nina’s Cookie Emporium named CookieDemo that declares and demonstrates objects of the CookieOrder class and its descendants. The CookieOrder class includes the following auto-implemented properties:
- OrderNum - The order number
- Name - The recipient’s name
- CookieType - The cookie type (for example, chocolate chip)
The class should also include fields for number of dozens ordered and price (named Dozens and Price). When the field value for number of dozens ordered is set, the price field is set as $15 per dozen for the first two dozen and $13 per dozen for each dozen over two.
Next, create a child class named SpecialCookieOrder, which includes a field with a description as to why the order is special (for example, gluten-free). Override the method that sets a CookieOrder’s price as described in the step above, but also to include special handling, which is $10 for orders up to $40 and $8 for higher-priced orders.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Write an application for Nina’s Cookie Emporium named CookieDemo that declares and demonstrates objects of the CookieOrder class and its descendants. The CookieOrder class includes the following auto-implemented properties: OrderNum - The order number Name - The recipient’s name CookieType - The cookie type (for example, chocolate chip) The class should also include fields for number of dozens ordered and price (named Dozens and Price). When the field value for number of dozens ordered is set, the price field is set as $15 per dozen for the first two dozen and $13 per dozen for each dozen over two. Next, create a child class named SpecialCookieOrder, which includes a field with a description as to why the order is special (for example, gluten-free). Override the method that sets a CookieOrder’s price as described in the step above, but also to include special handling, which is $10 for orders up to $40 and $8 for higher-priced orders.(assume "OrderNum" is actually a string and the…Write an application for Nina’s Cookie Emporium named CookieDemo that declares and demonstrates objects of the CookieOrder class and its descendants. The CookieOrder class includes the following auto-implemented properties: OrderNum - The order number Name - The recipient’s name CookieType - The cookie type (for example, chocolate chip) The class should also include fields for number of dozens ordered and price (named Dozens and Price). When the field value for number of dozens ordered is set, the price field is set as $15 per dozen for the first two dozen and $13 per dozen for each dozen over two. Next, create a child class named SpecialCookieOrder, which includes a field with a description as to why the order is special (for example, gluten-free). Override the method that sets a CookieOrder’s price as described in the step above, but also to include special handling, which is $10 for orders up to $40 and $8 for higher-priced orders. An example of the program is shown below: Order…Write an application for Nina’s Cookie Emporium named CookieDemo that declares and demonstrates objects of the CookieOrder class and its descendants. The CookieOrder class includes the following auto-implemented properties: OrderNum - The order number Name - The recipient’s name CookieType - The cookie type (for example, chocolate chip) The class should also include fields for number of dozens ordered and price (named Dozens and Price). When the field value for number of dozens ordered is set, the price field is set as $15 per dozen for the first two dozen and $13 per dozen for each dozen over two. Next, create a child class named SpecialCookieOrder, which includes a field with a description as to why the order is special (for example, gluten-free). Override the method that sets a CookieOrder’s price as described in the step above, but also to include special handling, which is $10 for orders up to $40 and $8 for higher-priced orders. (assume "OrderNum" is actually a string and the…
- Write a C# application AutomobileDemo that prompts a user for data for eight Automobile objects. The Automobile class includes the following auto-implemented properties: IdNumber - The ID number (an int) Make - The make (a string) Year - The year (an int) Price - The price (a double) Override the ToString() method to return all the details for an Automobile. During data entry, re-prompt the user if any ID number is a duplicate. Sort the objects in ID number order, and display all their data as well as a total of all their prices. For example if, the output should be in the following format (only two automobiles shown): Automobile 1 2017 honda Price is $30,000.00 Automobile 45 2016 Toyota Price is $20,000.00 Total for all Automobiles is $50,000.00. using System; using static System.Console; using System.Globalization; class AutomobileDemo { static void Main() { // Your code here } }JAVA PROGRAM For this program, you are tasked to implement the Beverage class which has the following private properties: name - a string value volume - this is an integer number which represents its current remaining volume in mL isChilled - this is a boolean field which is set to true if the drink is chilled It should have the following methods: isEmpty() - returns true if the volume is already 0 {toString() - returns the details of the object in the following format: {name} ({volume}mL) {"is still chilled" | "is not chilled anymore"}.Example returned strings: Beer (249mL) is still chilled Water (500mL) is not chilled anymore A constructor method with the following signature: public Beverage(name, volume, isChilled) Getter methods for all the 3 properties. Then, create two final subclasses that inherit from this Beverage class. The first one is the Water class which has the additional private property, type, which is a String and can only be either "Purified", "Regular",…Write a program named DemoJobs for Harolds Home Services. The program should instantiate several Job objects and demonstrate their methods. The Job class contains four data fields—description (for example, wash windows), time in hours to complete (for example, 3.5), per-hour rate charged (for example, $25.00), and total fee (hourly rate times hours). Include properties to get and set each field except the total fee—that field will be read-only, and its value is calculated each time either the hourly fee or the number of hours is set. Overload the + operator so that two Jobs can be added. The sum of two Jobs is a new Job containing the descriptions of both original Jobs (joined by and), the sum of the time in hours for the original Jobs, and the average of the hourly rate for the original Jobs. Harold has realized that his method for computing the fee for combined jobs is not fair. For example, consider the following: His fee for painting a house is $100 per hour. If a job takes 10 hours, he earns $1000. His fee for dog walking is $10 per hour. If a job takes 1 hour, he earns $10. If he combines the two jobs and works a total of 11 hours, he earns only the average rate of $55 per hour, or $605. Devise an improved, weighted method for calculating Harolds fees for combined Jobs and include it in the overloaded operator+() method. Write a program named DemoJobs2 that demonstrates all the methods in the class work correctly.
- a. Write a FractionDemo program that instantiates several Fraction objects and demonstrates that their methods work correctly. Create a Fraction class with fields that hold a whole number, a numerator, and a denominator. In addition: Create properties for each field. The set access or for the denominator should not allow a 0 value; the value defaults to 1. Add three constructors. One takes three parameters for a whole number, numerator, and denominator. Another accepts two parameters for the numerator and denominator; when this constructor is used, the whole number value is 0. The last constructor is parameterless; it sets the whole number and numerator to 0 and the denominator to 1. (After construction, Fractions do not have to be reduced to proper form. For example, even though 3/9 could be reduced to 1/3, your constructors do not have to perform this task.) Add a Reduce() method that reduces a Fraction if it is in improper form. For example, 2/4 should be reduced to 1/2. Add an operator+() method that adds two Fractions. To add two fractions, first eliminate any whole number part of the value. For example, 2 1/4 becomes 9/4 and 1 3/5 becomes 8/5. Find a common denominator and convert the fractions to it. For example, when adding 9/4 and 8/5, you can convert them to 45/20 and 32/20. Then you can add the numerators, giving 77/20. Finally, call the Reduce() method to reduce the result, restoring any whole number value so the fractional part of the number is less than 1. For example, 77/20 becomes 3 17/20. Include a function that returns a string that contains a Fraction in the usual display format—the whole number, a space, the numerator, a slash (D, and a denominator. When the whole number is 0, just the Fraction part of the value should be displayed (for example, 1/2 instead of 0 1/2). If the numerator is 0, just the whole number should be displayed (for example, 2 instead of 2 0/3). b. Add an operator*() method to the Fraction class created in Exercise 11a so that it correctly multiplies two Fractions. The result should be in proper, reduced format. Demonstrate that the method works correctly in a program named FractionDemo2. c. Write a program named FractionDem03 that includes an array of four Fractions. Prompt the user for values for each. Display every possible combination of addition results and every possible combination of multiplication results for each Fraction pair (that is, each type will have 16 results).Write a program named SalespersonDemo that instantiates objects using classes named Real EstateSalesperson 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 objects 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 Salespersons full name—the first and last names separated by a space. Then perform the following Create two child classes of Salesperson: Real EstateSalesperson and Girl Scout. The Real EstateSalesperson 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 Girl Scout 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 ISell able that contains two methods: SalesSpeech() and MakeSale(). In each Real EstateSalesperson and Girl Scout class, implement SalesSpeech() to display an appropriate one- or two-sentence sales speech that the objects of the class could use. In the Real Estatesalesperson class, implement the MakeSale() method to accept an integer dollar value for a house, add the value to the Real EstateSalespersons total value sold, and compute the total commission earned. In the Girl Scout class, implement the MakeSale() method to accept an integer representing the number of boxes of cookies sold and add it to the total field.In C#, Create a program named ConferencesDemo for a hotel that hosts business conferences. Allows a user to enter data about five Conference objects and then displays them in order of attendance from smallest to largest. The Conference class contains fields for the following: group - The group name (as a string) date - The starting date (as a string) attendees - The number of attendees (as an int) Include properties for each field. Also, include an IComparable.CompareTo() method so that Conference objects can be sorted in order from least to greatest attendees.
- Write a program named DemoJobs for Harold’s Home Services. The program should instantiate several Job objects and demonstrate their methods. The Job class contains four data fields—description (for example, “wash windows”), time in hours to complete (for example, 3.5), per-hour rate charged (for example, $25.00), and total fee (hourly rate times hours). Include properties to get and set each field except the total fee—that field will be read-only, and its value is calculated each time either the hourly fee or the number of hours is set. Overload the + operator so that two Jobs can be added. The sum of two Jobs is a new Job containing the descriptions of both original Jobs (joined by and), the sum of the time in hours for the original Jobs, and the average of the hourly rate for the original Jobs.Java Programming: Practice your class design and development process by creating 2 classes based on the following: Home class where every Home has a square footage, number of bedrooms, number of bathrooms, and list price Address class where every Address has a home number, street name, city, state, and zip code You must decide what properties are appropriate to support these ideas and what data types to use for them For both classes, you must at least have a default constructor (switch...case...default)[This is important. Please have this in the code], at least one overloaded constructor, all set/get methods, and a toString function For the Home class, also provide method(s) to determine if a home is large and if it has more than one bathroom For the Address class, provide method(s) to determine if an address is in a given city, state, or zip code Write a test program that adequately tests all the classes and all their functions You can hard code your test values in main where you…Write the application AutomobileDemo that prompts a user for data for eight Automobile objects in C# language The Automobile class includes the following auto-implemented properties: IdNumber - The ID number (an int) Make - The make (a string) Year - The year (an int) Price - The price (a double) Override the ToString() method to return all the details for an Automobile. During data entry, re-prompt the user if any ID number is a duplicate. Sort the objects in ID number order, and display all their data as well as a total of all their prices. For example if, the output should be in the following format (only two automobiles shown): Automobile 1 2017 honda Price is $30,000.00 Automobile 45 2016 Toyota Price is $20,000.00 Total for all Automobiles is $50,000.00