Write a program by creating an 'Employee' class having the following methods and print the final salary. 1 - 'getInfo()' which takes the salary, number of hours of work per day of employee as parameter 2 - 'AddSal()' which adds $10 to salary of the employee if it is less than $500. 3 - 'AddWork()' which adds $5 to salary of employee if the number of hours of work per day is more than 6 hours
Q: Write a class that prompts the user for the day’s high and low temperatures. If the high is greater…
A: Step 1:- Note:-I am writing the program in the java language Program Approach:- Import the…
Q: Write a compareTo method that compares two Song objects based on the artist, and title within…
A: The solution to the given problem is below.
Q: Write a class, AgeMessages , which does the following: a. Ask the user to enter age using a Scanner…
A: The if function is one of the logical functions to return one value if a condition is true and…
Q: Write a program by creating an 'Employee' class having the following methods and print the final…
A: /* Java program */import java.util.*; class EmployeeDetail { private String name; private float…
Q: You can see that students have a name, a number, some marks for subjects they are studying and the…
A: The given UML diagram is:
Q: Question: 2 Implement the design of the Chillox and Customer classes so that the following code…
A: Algorithm: Start Create Chillox class with menu and order_id as its static varibales Implement…
Q: I just want you to do the second part only using java class, but i have attached the answer for…
A: Solution:: Assignment 1: public class LoanAccount { // properties…
Q: Implement a class Car with the following properties. A car has a certain fuel efficiency (measured…
A: public class Car{ public static void main(String[] args){ Car myHybrid = new Car(50);…
Q: A test will input numbers so no user input is required. An integer will be input. Take that value…
A: Given :- A test will input numbers so no user input is required. An integer will be input. Take that…
Q: Print the arrival time of the flight using a combination of methods from Flight and LocalTime • Read…
A: A flight object is created using parameterized constructor and then the changes are made and…
Q: Write a class called Investment with fields called principal and interest. The constructor should…
A: In Python classes, "__init__" is a reserved process. In object-oriented programming, it's referred…
Q: Implement the design of the Chillox and Customer classes so that the following code generates the…
A: Algorithm: Start Create Chillox class with menu and order_id as its static varibales Implement…
Q: Write a class, AgeMessages , which does the following:a. Ask the user to enter age using a Scannerb.…
A: The given below is the code to enter the age through user and print the message according to age. To…
Q: Write a method toString() for the Cow class which displays information about a Cow object. The…
A: Since no programming language is mentioned, I am using python. Assuming stomach is class variable of…
Q: Write a program by creating an 'Employee' class having the following functions and print the final…
A: Required: To Write a program by creating an 'Employee' class having the following functions and…
Q: The following methods should output simple text messages on the screen for feedback, when…
A: As the student only asked about the plane class. Im Providing the Plane Class in Java Program below:
Q: IN C++ Implement a class Car with the following properties. A car has a certain fuel efficiency…
A:
Q: Exercise 3: A. Write static methods: • public static double sphereVolume(double r) : r³ • public…
A: Here I have created a class named Geometry. In this class, I have created all 4 methods and then…
Q: Write a class, AgeMessages , which does the following:a. Ask the user to enter age using a Scannerb.…
A: The algorithm for the program would be as below:Declare one float variable for accepting user…
Q: Write a class called Investment with fields called principal and interest. The constructor should…
A: class Investment //Declaration of class Investment{ long principal,interest; //Declaring…
Q: Implement the design of the Chillox and Customer classes so that the following code generates the…
A: The answer is
Q: Construct an OOP using classes and objects to find the distance travelled by a Vehicle in t" seconds…
A: Logic: Create class and create object. Declare members of the program. Call the method using the…
Q: Write a class called Date that represents a date consisting of a year, month, and day. A Date object…
A: class Date{private int day;private int month;private int year;//constructorpublic…
Q: Scenario Write a calendar class that uses enums to find out which month and day of the week it is.…
A: Answer
Q: 1/ Implement a class Employee. An employee has a name (a string) and a salary (a double). Provide a…
A: Note: This is a multiple-question-based problem. The only first question is solved. Kindly send the…
Q: This time we want the Animal greeting method to be modified so that it will be: Hello, my name is…
A: It is defined as programs can be asked from control statements, array, string, oops etc. Java basic…
Q: Write a class RangeInput that allows users to enter a value within a range of values that is…
A: CODE TEXT SO YOU DON'T HAVE TO TYPE. public class RangeInput { private int currentValue;…
Q: Write a class, AgeMessages , which does the following:a. Ask the user to enter age using a Scannerb.…
A: //Import required packagesimport java.util.Scanner; //Definition of class "AgeMessage"public class…
Q: Write a class that contains the following two methods: /** Convert from Celsius to Fahrenheit */…
A: code : - public class Main{ public static double celsiusToFahreheit(double celsius) {…
Q: Write a method drivingCost() with input parameters milesPerGallon, dollars PerGallon, and miles…
A: 1) Below is program to calculate the driving cost for drivenMiles, milesPerGallon, dollarsPerGallon…
Q: • Write a class to simulate a bank account. • Data • Title name • balance • Constructors • One…
A: Bank.java --------------------------- public class Bank { //declaring data String titleName; private…
Q: Write full code for the classes represented in the UML diagram below. Keep the methods as short as…
A: + represents public members # represents protected members - represents private members
Q: Write the Director class with the required methods to give the following outputs as shown.
A: class Director: def __init__(self,*args): self.__director = '' self.__movie = {}…
Q: Create another class DayProg and write the main() method to display the following: Today is…
A: As the language is not specified answer written in python to deal with date and time we need to…
Q: Computer Science Write a program for a toy-car manufacturing plant. Assuming that 10 toy-cars can…
A: According to the information given:- We have to follow the instruction to get bill for the customer…
Q: The formula for converting a temperature from Fahrenheit to Celsius is: C = 5/9(F – 32) where F is…
A: Objective: This program implements temperature conversion using class and methods. Programming…
Q: Write a simple cash register class. (Use Java) Each cash register should keep track of the number…
A: ############################################################## The code for your class is given…
Q: Write a method drivingCost() with input parameters drivenMiles, milesPerGallon, and…
A: Program Explanation: Import the essential java libraries. Define the method “drivingCost” which…
Q: Write a class RangeInput that allows users to enter a value within a range of values that is…
A: Given The answer is given below. CODE:- import java.util.Scanner; class RangeInput { static int…
Q: Write method fullName with a return type of void and accept a name. The method will display the…
A: public static void fullName(String name) { String temp = " " + name; String newStr…
Q: Create a "tank" class and use it in a program that accepts height and radius from the user and…
A: The class tank will be created using the keyword class. The __init__ function will initialize the…
Q: In this chapter, the class Date was designed to implement the date in a program, but the method…
A: /* Java program to test class */ public class Date { // Instance variables int day;…
Q: Write a class, NumberToMonth, which does the following: a. Ask the user to enter the month of the…
A: Here goes the program in python as no specific language was mention: month=int(input("Enter a month…
Q: Write a method toString() for the Cow class which displays information about a Cow object. The…
A: We have provided java code for given scenarios: We need to provide toString() method for given class…
Q: Write a class that contains the following two methods: /** Convert from feet to meters */ public…
A: Class is a user-defined data type in which it binds the member data and member methods. Declare the…
Write a
1 - 'getInfo()' which takes the salary, number of hours of work per day of employee as parameter
2 - 'AddSal()' which adds $10 to salary of the employee if it is less than $500.
3 - 'AddWork()' which adds $5 to salary of employee if the number of hours of work per day is more than 6 hours
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
- Write a class that contains the following two methods: /** Convert from Celsius to Fahrenheit */ public static double celsiusToFahrenheit(double celsius) /** Convert from Fahrenheit to Celsius */ public static double fahrenheitToCelsius(double fahrenheit) The formula for the conversion is as follows: fahrenheit = (9.0 / 5) * celsius + 32 celsius = (5.0 / 9) * (fahrenheit – 32) Write a test program that invokes these methods to display the following table: NOTE: Celsius starts at 40 and should be converted to Fahrenheit, on the same line Fahrenheit starts at 120 and should be converted to Celsius Do not forget to Introduce your Program to the user with descriptive information. Do not forget to include a block Comment header at the start of your Source Code.Write a class RangeInput that allows users to enter a value within a range of values that is provided in the constructor. An example would be a temperature control switch in a car that allows inputs between 60 and 80 degrees Fahrenheit. The input control has “up” and “down” buttons. Provide up and down methods to change the current value. The initial value is the midpoint between the limits. As with the preceding exercises, use Math.min and Math.max to limit the value. Write a sample program that simulates clicks on controls for the passenger and driver seats. PLEASE USE THE TEMPLATES PROVIDED AND ENSURE THAT IT WORKS WITH THE TEST CLASSWrite a class RangeInput that allows users to enter a value within a range of values that is provided in the constructor. An example would be a temperature control switch in a car that allows inputs between 60 and 80 degrees Fahrenheit. The input control has “up” and “down” buttons. Provide up and down methods to change the current value. The initial value is the midpoint between the limits. As with the preceding exercises, use Math.min and Math.max to limit the value. Write a sample program that simulates clicks on controls for the passenger and driver seats. Please ensure that it works with the test class provided.
- Write a java program in a class CountPoor that counts the number of families that are considered poor. Write and use a class Family that has the attributes. income—a double value that is the income for the family size—the number of people in the family and the following methods: Family(income, size)—a constructor that sets the attributes isPoor(housingCost, foodCost)—a method that returns true if housingCost + foodCost * size is greater than half the family income (foodCost is the average food cost for an individual, while housingCost is for the family) toString—a method that returns a string containing the information about the family The program should read an integer k from the keyboard and then create an array of size k whose base type is Family. It should then create k objects of type Family and put them in the array, reading the income…The formula for converting a temperature from Fahrenheit to Celsius is: C = 5/9(F – 32) where F is the temperature in Fahrenheit and C is the temperature in Celsius. Write a class called TemperatureConversion that includes methods that: • Convert Celsius to Fahrenheit. The Celsius temperature is passed as a parameter and it returns the corresponding Fahrenheit temperature. • Convert Fahrenheit to Celsius. The Fahrenheit temperature is passed as a parameter and it returns the corresponding Celsius temperature. Demonstrate the methods by using loops to display the Fahrenheit temperatures 32 through 212 and their Celsius equivalents and the Celsius temperatures between 0 and 100 and their Fahrenheit equivalents. in c#Write a class that prompts the user for the day’s high and low temperatures. If the high is greater than or equal to 90 degrees, display the message, “Heat warning.” If the low is less than 32 degrees, display the message “Freeze warning.” If the difference between the high and low temperatures is more than 40 degrees, display the message, “Large temperature swing.”
- IN C++ Implement a class Car with the following properties. A car has a certain fuel efficiency (measured in miles/gallon or liters/km—pick one) and a certain amount of fuel in the gas tank. The efficiency is specified in the constructor, and the initial fuel level is 0. Provide another parameterized constructor which takes both efficiency and fuel as parameters. Also supply methods getGasInTank, returning the current amount of gasoline in the fuel tank. getEfficiency() return the efficiency of car. setGasInTank(double fuel), to add gasoline to the fuel tank. setEfficiency(double efficiency) Supply a method Drive () that simulates driving the car for a certain distance, reducing the amount of gasoline in the fuel tank according to its efficiency. Sample usage: Car myHybrid (50); // 50 miles per gallon myHybrid.addGas(20); // Tank 20 gallons myHybrid.Drive(100); // Drive 100 miles double gasLeft = myHybrid.getGasInTank(); // Get gas remaining in tank Supply a main method that tests…Write a class called Investment with fields called principal and interest. The constructor should set the values of those fields. There should be a method called value_after that returns the value of the investment after n years. The formula for this is p(1+i)ⁿ, where p is the principal, and i is the interest rate.Write a class, AgeMessages , which does the following:a. Ask the user to enter age using a Scannerb. If the age is less than 13, print: “too young to create a Facebook account”c. If the age is less than 16, print: “too young to get a driver's license”d. If the age is less than 18, print: “too young to get a tattoo”e. If the age is less than 21, print: “too young to drink alcohol”f. If the age is less than 35, print: “too young to run for President of the U.S.” and on nextline print: “(How sad!)”g. If the age is greater and equal to 35, print: “able to do anything” and on next line print:“(How happy!)”Tips Use an if statementSubmission Copy and paste your code Screen shot the console with user input of 2 Screen shot the console with user input of 18 Screen shot the console with user input of 91
- Write a class, AgeMessages , which does the following:a. Ask the user to enter age using a Scannerb. If the age is less than 13, print: “too young to create a Facebook account”c. If the age is less than 16, print: “too young to get a driver's license”d. If the age is less than 18, print: “too young to get a tattoo”e. If the age is less than 21, print: “too young to drink alcohol”f. If the age is less than 35, print: “too young to run for President of the U.S.” and on nextline print: “(How sad!)”g. If the age is greater and equal to 35, print: “able to do anything” and on next line print:“(How happy!)”Write a class, AgeMessages , which does the following:a. Ask the user to enter age using a Scannerb. If the age is less than 13, print: “too young to create a Facebook account”c. If the age is less than 16, print: “too young to get a driver's license”d. If the age is less than 18, print: “too young to get a tattoo”e. If the age is less than 21, print: “too young to drink alcohol”f. If the age is less than 35, print: “too young to run for President of the U.S.” and on next line print: “(How sad!)”g. If the age is greater and equal to 35, print: “able to do anything” and on next line print: “(How happy!)”Use an if statementCould you tell me how to fix the error in testing the following code: class Employee:""" The employee class has a constructor and getter methods.The constructor has input arguments"""# Assigns values for id, name, salary, and email from input argumentsdef __init__(self, i, n, s, e):self.id = iself.name = nself.sal = sself.email = e# getter function for namedef get_name(self):return self.name# getter function for IDdef get_id(self):return self.id# getter function for salarydef get_sal(self):return self.sal# getter function for emaildef get_email(self):return self.emaildef make_employee_dict(ids, names, sal, emails):"""Function to create employee object and the dictionaryusing those objects"""# k is the length of all the listsk = len(ids)emp_dict = dict()# Making employee object and adding to dictionaryfor i in range(k):e = Employee(ids[i], names[i], sal[i], emails[i])emp_dict[ids[i]] = e# return the dictionaryreturn emp_dict# Testingemp_names = ["Jean", "Kat", "Pomona"]emp_ids = ["100",…