The following code may, or may not, work. However the bigger issue is that it doesn't give good information to the end user. Assume that there is a Circle class, like we've defined in class before. Fix what problems you see, that could affect naming conventions, capitalization, and data output, and make sure the data output is clean for the end user. cout << "For Circle 1:" << endl; cout << c1.getArea() << endl; cout << c1.getx() << " " << c1.gety() << endl; cout << c1.getcolor() << endl; cout << endl << endl; This is the full question and it is c++
Q: Write a C# program that implements a class of your own design. Your class should have minimum of…
A: Program using System;public class Person{ public Person() //default constructor {…
Q: 2) You must implement the pieces of the below classes on the following pages. You only should…
A: Given: class Point {public:Point();Point(double, double);double getX() const;double getY()…
Q: The two header files below describe the interface of the base class Person and its derived class…
A: The C++ program is given by Person.cpp #include "Person.h" Person::Person() { SSN=0; name="na";…
Q: n this lab, you will construct a class called QuadraticSolver that will compute the real roots of a…
A: Answer
Q: Write a program which has a class called Character having a character data member. Overload the…
A: #include <iostream>#include <iomanip>#include <string> using namespace std; int…
Q: 2) You must implement the pieces of the below classes on the following pages. You only should…
A: //constructor #1Rectangle::Rectangle(){ll = Point();w = 0;h = 0;}
Q: TRICTLY USE TEMPLATE PROVIDED AT END OF QUESTION. FOLLOW WHAT IS GIVEN IN QUESTION…
A: Required: program in c++ and must match output as it is . ------------------------------------…
Q: change the main class so that the user is the one that as to put the name in other words. Write a…
A: using System; class HealthProfile {public string FirstName;public string LastName;public int…
Q: • If you do not have a copy constructor function for Date , add it to the class definition, which is…
A: C++ code: #include <iostream>#include <stdlib.h>#include <string>using namespace…
Q: Previous Exercise to help with answering the question which is below | Write the header file (.h…
A: Answer :
Q: class Rational * represents a Rational number. Remember rational means ratio-nal * which means there…
A: I compiled your program using dev c++ software (-1/3)+(4/5)=-7/15 you have to consider the "-"
Q: An Important part of typechecking is the uhification two type terms. Can the follOwing two types be…
A: It is a process where in the equations which have some symbolic expression can be solved. Basically,…
Q: Love Get an input from a user with the question: Who is your favorite professor? If the input is…
A: Note :- You have not mention the language of the program so, i'm answering your question in C++…
Q: Write a program which has a class called Character having a character data member. Overload the…
A: Given question has asked to write a program which has a class called Character having a character…
Q: PLEASE TRACE BY HAND OR SHOW WHAT EACH VALUE IS ASSIGNED TO and SHOW the OUTPUT for the following…
A: Task Set : In the given question , we have given the code in C++. We need to trace the output of…
Q: The assignment will test your understanding of handling and working with Java Throwables. On the…
A: import java.io.*;class Main { public static void main(String[] args) throws Exception{ try {…
Q: I have the basis of a program that works as an inventory, it reads the contents of a file and…
A: Required: I have the basis of a program that works as an inventory, it reads the contents of a…
Q: class A Q5: Correct the following code fragment and what will be the final results of the variable a…
A: Source Code #include <iostream> using namespace std; class A { protected: int…
Q: You’ve learned about function argument annotations and you have a thought that you might be able to…
A: Question:- You’ve learned about function argument annotations and you have a thought that youmight…
Q: ABC Bank announced a new scheme of reward points for a transaction using an ATM card. Each…
A: Coded using C++.
Q: Write a student class that will keep track of the grades of students and generates a final mark. You…
A: The weightage can be calculated by multiplying the weightage percentage with unit marks
Q: Find the error(s) in the following code: class opOverload…
A: Error: There is a error with the line 4 and the corrected complete code snippet is given below and…
Q: Show the output of the following code: #include <iostream> using namespace std;class Parent…
A: Answer: Create a derived class that is inherited from the base class. // Derived class class child…
Q: java. write grading program for a class with the following grading policies. thers a total of 2…
A: Program1 public class gradingProgram{public static void main(String[] args){int quiz1;int quiz2;int…
Q: Thanks for your input. The last project I was helped with through this service really improved my…
A: For writing the program which takes a decimal value and prints its equivalent roman numeral value,…
Q: Please help with the following: C# .NET change the main class so that the user is the one that as…
A: using System; class HealthProfile {public string FirstName;public string LastName;public int…
Q: Please finish this program in the main() function, so that we get the output 1 2. class Basel {…
A: #include <iostream>using namespace std;class Base1{ private: double data; public:…
Q: Overload all relational operators (, =, ==, and !=) for Box class. The boxes must be compared…
A: According to the information given:- We have to perform overloading of all relational operators…
Q: USING C++ Using the class declaration below, implement the functions: class Rectangle {…
A: According to the information given:- We have to create and find the area of the rectangular space…
Q: Answer the following questions for the program below: 1 #include <iostream>2 using namespace…
A: Given: Answer the following questions for the program below: 1 #include <iostream>2 using…
Q: Equation Slope (-a / b) Is point (5, -2) on the line? 5x+ 4y - 17 - 0 -5/4--1.25 Yes, because 5(5) +…
A: Source Code: APLine.java: public class APLine { private int a; private int b;…
Q: Study the following definition of class testType, and answer the question be class testType public:…
A: #include <bits/stdc++.h>using namespace std; class testype {public: void setdata(double f,…
Q: Write a program which have a class named as “Student”, while the data members of the class are,…
A: Note:- we are allowed to answer only one question according to policy. char name[10], int age;…
Q: * Which among the following is not true ?for polymorphism Ease in readability of program O It is…
A: Which among the following is not true for polymorphism? Increases overhead of function definition…
Q: Please Solve the Question in C++ as quickly as you can in 40 minutes. And do the same as asked in…
A: Algorithm: Start Create a template class SafeArray with data members size, Array Define a…
Q: Executes without crashing Appropriate Internal Documentation Pet Class Data members: name,…
A: java is an object oriented programming language. It is a platform independent. A class can be…
Q: Write the SultansDine class so that the given code provides the expected output. [You are not…
A: Write the SultansDine class so that the given code provides the expected output.
Q: Create a lecturer class with member -data name (name) and department (department). For the Lecturer…
A: The programming instructions are as follows: Create a class lecturer. The data members are a name…
Q: I have the basis of a program that works as an inventory, it reads the contents of a file and…
A: The ask is to do the following: - Update the program use a Class instead of struct - Add a function…
Q: Complete the following source code by include the default constructor for its class. The default…
A: Start create data members create data methods create function to set value print datamemebrs…
Q: Write the definition and implementation of class Measures. First, write the class's header then…
A: Program: #include<bits/stdc++.h> using namespace std; class Measures{ private:…
Q: OU ONLY NEED TO EDIT date.h, dateOFYear.h, and dateOFYear.cpp date.h | date.cpp | dateOfYear.h |…
A: The program is implemented below in C++:
Q: Write a program in java a class Box having three private data members (width, depth, height) The…
A: File name: “Box.java” public class Box { private double width; private double depth;…
Q: I am having issues when I run my c++ code it passes all of the test cases besides this one can,…
A: Error in your Code- The error is in the input function. Your code cannot handle input of negative…
Q: I have the basis of a program that works as an inventory, it reads the contents of a file and…
A: Required: I have the basis of a program that works as an inventory, it reads the contents of a file…
Q: This chapter defines the class clockType to implement time in a program. Add functions to this class…
A: Program: //include the header file #include <iostream> using namespace std; //definition…
Q: Local declarations are those that are kept in the memory of the computer; but, how exactly are they…
A: Encryption: Variables in a Local declaration are kept in the Stack data structure. The stack data…
Q: Please solve it using python. I also add the picture and write the question follow which one you…
A: class CSEDepartment: def __init__(self, name, credit): self.name = name self.credit =…
Q: This is for C++ only, and I will be using visual studio as a compiler. You can use dummy variables…
A: #include"stdafx.h" #include<iostream> #include<string> #include "CustomerData.h" using…
The following code may, or may not, work. However the bigger issue is that it doesn't give good information to the end user. Assume that there is a Circle class, like we've defined in class before.
Fix what problems you see, that could affect naming conventions, capitalization, and data output, and make sure the data output is clean for the end user.
cout << "For Circle 1:" << endl;
cout << c1.getArea() << endl;
cout << c1.getx() << " " << c1.gety() << endl;
cout << c1.getcolor() << endl;
cout << endl << endl;
This is the full question and it is c++
Step by step
Solved in 2 steps
- Use this exercise to test your code that you wrote in the previous exercise. Problem Class In this exercise, you are going to create the Problem class. The Problem class is used to help simulate a math fact, for example: 2 + 5 = Your class needs to contain two constructors, one that takes String, int, int that represents the operator sign(+, -, *, or /), the minimum, and maximum values for the number range, and a second constructor that takes only a String that represents the operator sign. For the second constructor, the minimum should default to zero and the maximum to ten. Your Problem object should generate 2 random integers between the minimum and maximum values (inclusively). Each Problem object should only have one set of numbers that do not change. While you may include additional helper methods, two methods need to be available to the user. The first is the answer method that should return a double that represents the answer to the problem. The second is the toString that…Reuse your Car class . In a main, build an object of that class, and print out the object using System.out.println(). Notice that this simply reports the memory address of the object in question, and we’d like to do something more useful. To replace (or override) the toString (or equals) function. Now, build a toString function that prints out the make, model, and odometer reading for a vehicle object. public class Car { //instance variables private int odometer; private String make; private String model; //overloading //constructors public Car(int odometer,String make, String model) { this.odometer = odometer; this.make = make; this.model = model; } public Car(String make, String model) { this.make = make; this.model = model; } public Car(String make) { this.make = make; } /* *getter & setter methods */ public int getOdometer() { return odometer; } public void…Please, I want to modify the code so that the user can add the employee's name, number and specialization, and use for loob He must add more than one employee. When he finishes adding the employee’s data, he asks the user: Do you want 1-Print the data 2-Add a new employee 3-Exit class Doctor:"""Represents a Doctor""" #initializer with specialization default to "general"def __init__(self, Id, name, specialization="general"):#attributesself.Id = Idself.name = nameself.specialization = specialization.lower() #initializing salary to 25000, basic salaryself.salary = 25000 #incrementing salary based on specialization#if specialization is pediatric, increasing salary by 10%if specialization == "pediatric":self.salary += self.salary*10/100 #if specialization is dental, increasing salary by 15%elif specialization == "dental":self.salary += self.salary*15/100 #str() functiondef __str__(self):return (f"Id: {self.Id} \n"f"Name: {self.name} \n"f"Specialization: {self.specialization} \n"f"Salary:…
- I already have the code for the assignment below, but the code has an error in the driver class. Please help me fix it. The assignment: Make a recursive method for factoring an integer n. First, find a factor f, then recursively factor n / f. This assignment needs a resource class and a driver class. The resource class and the driver class need to be in two separate files. The resource class will contain all of the methods and the driver class only needs to call the methods. The driver class needs to have only 5 lines of code The code of the resource class: import java.util.ArrayList;import java.util.List; public class U10E03R{ // Recursive function to // print factors of a number public static void factors(int n, int i) { // Checking if the number is less than N if (i <= n) { if (n % i == 0) { System.out.print(i + " "); } // Calling the function recursively // for the next number factors(n, i +…Can I get help writing this with these parameters To give you an idea of the general criteria that will be used for grading, here is a checklist that you might find helpful: Executes without crashing Appropriate Internal Documentation Pet Class Data members: name, type, weight Constructor/destructor Getters/setters as appropriate Main: The following items must be implemented in main() or by functions called from main() They must not be implemented in the Pet class Prompts user for the number of pets Creates the pet array using dynamic memory allocation Dynamically creates a pet object Generates a random weight (between 1-100 inclusive) for each pet Seed is 100 Prints contents of array as illustrated in diagram De-allocates memory (both the array and the contents of the array) before exiting Style: Modular design, no global variables, etc.In the below code I get the following error when running the test for verifying of stored private data members: Error = Test Failed: 'Employee' object has no attribute '_name' class Employee:""" Employee class that has a constructor with input arguments and getter methods."""# Defining private variables of employee class# Constructor and initialization of employee attributesdef __init__(self, name, id, sal, mail):self.__emp_name = nameself.__emp_id = idself.__emp_sal = salself.__emp_mail = mail# Getter methods for private variables defined abovedef get_name(self):return self.__emp_namedef get_ID_number(self):return self.__emp_iddef get_salary(self):return self.__emp_saldef get_email_address(self):return self.__emp_maildef make_employee_dict(names, ids, sal, mails):"""Function to create employee objects and return the dictionary using those objects"""diction = {}for i in range(len(names)):# Making employee object and adding to dictionaryemp = Employee(names[i], ids[i], sal[i],…
- Please solve it using python. I also add the picture and write the question follow which one you prefer. Design CSEProgram class and CSProgram class which inherit CSEDepartment class so that the following code provides the expected output. addStudentWithCreditsCompleted and addStudentWithCreditsRemaining methods should work for any number of arguments assuming that there will always be an even number of arguments. class CSEDepartment: def __init__(self, name, credit): self.name = name self.credit = credit def __str__(self): s = "Program: "+self.name+", Credit hours: "+str(self.credit) return s # Write your codes here. # Do not change the following lines of code. p1 = CSEProgram("CSE", 136) print("1.=================================") p1.addStudentWithCreditsCompleted("Bob", 12, "Carol", 18,"Mike", 15) print("2.=================================") print(p1) print("3.=================================") p2 = CSProgram("CS", 124)…Question: 2 Implement the design of the Laptop and Store classes so that the following code generates the output below: print("Total Laptop Created:",Laptop.total_laptop) print("1.=========================================") s1 = Store() p1 = Laptop("Lenovo B4180", 55000) print("2.=========================================") p2 = Laptop("HP Pavilion") print("3.=========================================") s1.add_laptop(p1, p2) print("4.=========================================") p2.setPrice(77000) s1.add_laptop(p2) print("5.=========================================") s1.sell_laptop("HP Probook") print("6.=========================================") print(s1) print("7.=========================================") s2 = Store("Star Tech") p3 = Laptop("HP Probook", 58000) print("8.=========================================") p4 = Laptop("Lenovo Thinkpad", 60000) print("9.=========================================") p5 = Laptop("HP Elite", 80000)…Question: 2 Implement the design of the Purchaser and AarongProducts classes so that the following code generates the output below: #Write your code here p1 = Purchaser('Alex Light') print('1.===============================') print(p1) product1 = AarongProducts('Decor', 'Photo-Frame') print('2.===============================') print(product1) print('3.===============================') print(AarongProducts.products) print('4.===============================') AarongProducts.include_products('Souvenirs',['Brass-Flowervase 2170', 'Terracotta-Vase 3500']) print(f'Updated Item List:\n{AarongProducts.products}') print('5.===============================') product2 = AarongProducts('Souvenirs', 'Terracotta-Vase', 2) print(product2) print('6.===============================') p1.create_invoice(product1, product2) print('7.===============================') product3 = AarongProducts('Decor', 'Candles', 5) print(product3) print('8.===============================') product4 =…
- You must implement the pieces of the below classes on the following pages. You only should implement the functions that are underlined and followed by a "TODO: implement" comment. An example main function is provided to help you test your solution. You may assume the other functions have been implemented correctly, and you may use them. class Point { public: Point(); Point(double, double); double getX() const; double getY() const; void setX(double); void setY(double); void move(double, double); private: double xCoord; double yCoord; public: // output format: (x,y) void display() const; }; class Rectangle { public: Rectangle(); Rectangle(const Point &ll, double w, double h); Rectangle(const Point &ll, const Point &ur); // TODO: implement // Output format - LL:(x,y) W:width H:height…You must implement the pieces of the below classes on the following pages. You only should implement the functions that are underlined and followed by a "TODO: implement" comment. An example main function is provided to help you test your solution. You may assume the other functions have been implemented correctly, and you may use them. class Point { public: Point(); Point(double, double); double getX() const; double getY() const; void setX(double); void setY(double); void move(double, double); private: double xCoord; double yCoord; public: // output format: (x,y) void display() const; }; class Rectangle { public: Rectangle(); Rectangle(const Point &ll, double w, double h); Rectangle(const Point &ll, const Point &ur); // TODO: implement // Output format - LL:(x,y) W:width H:height void…This is a debugging question I am struggling on - The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly. Code - public class DebugCustomer { protected int idNumber; protected String name; protected double creditLimit; public DebugCustomer(int id, name, double creditLimit) { idNumber = id; name = name; creditLimit = credit; } public void display() { System.out.println("Customer # + idNumber + Name: " + name, "\nCredit limit $" + creditLimit); } } ----- public class DebugCustomerMakingPurchase extends DebugCustomer { private double amountOfPurchase; private boolean overLimit; public DebugCustomerMakingPurchase(int id, String name, double credit, double purchAmount) { amountOfPurchase = purchAmount;…