1. Create a class named TaxCalculator with the following: a. A double data type variable named "annuallncome". b. A double data type array containing the following values in this order: 0, .1, .15, .23, .28, .33, .35 c. A method which takes annual income as a parameter and prints the tax calculate per the below tax bracket:
Q: Create a class named student with two overloaded methods named String[] info(String []name,int[]…
A: Note :- You have not mention the language of the program so i am doing you question in Java. Your…
Q: Create a Rectangle class to hold length and width in double variables. Write following functions to…
A: code: #include<bits/stdc++.h>using namespace std; //Class Rectangleclass Rectangle{ public:…
Q: 3. (a)How many parameters does the following constructor have? public Student (String name, int…
A: 3(a) Ans: Constructor student having two parameters name and stupid. 3(b) Ans: Student std = new…
Q: Part-1: Write a program that includes in its class the following methods: 1. A method named…
A: Code: public class MyClass { public static void printChars(char ch1,char ch2,int numberPerLine){…
Q: Problem 1 Create a class called Hangman with the field n (number of incorrect guesses (int)). •…
A: I give the code in python(As you were asked in python only) and provide the output and code…
Q: Question 2 (a) Write a program to repeatedly read in integers (negative and positive) from the user…
A: Class methods are the methods which are called on the class itself, not on the specific object…
Q: Q1. Create a class named "Conversions" having 3 conversion methods named 1. IntoMeter 2. IntoFeet 3.…
A: Program Approach: Import java utility package. Define class conversion. Define method IntoMeters()…
Q: Imagine some publishing company that markets both book and audio cassette versions of its works.…
A: #include<iostream> #include<stdio.h> #include<stdlib.h> #define MAX 100…
Q: I. Using the dialog boxes in the JOptionPane class, write a program that calculates and prints the…
A: PROGRAM: //Importing header import javax.swing.JOptionPane; //Defining class class…
Q: Create your own hero Use a class named ‘Char’ with string variables ‘fullname’, ‘weapon’, ‘vision’,…
A: In this question we have to write a C++ program with class and constructor for defining our hero.…
Q: Use java code to complete
A: public class TaxCalculator{ //declaring data variables private double annualIncome; private…
Q: Create a class named Employee with two variables Name,Salary and a method named Employee…
A: A class can be denoted as a unit that consists of data and functions, in a single unit. It acts as a…
Q: 32.5 QUESTION 3 Create an object called Circle. Declare the following integer variables for the…
A: Solution: Create a class Circle and declare the variables radius,diameter as integer types and pi…
Q: QUESTION 1 PROBLEM: Create your own massive multiplayer online game (MMORPG) hero. Use a class named…
A: Find the required code in C++ given as below and sample output :
Q: Use a class named 'Character' with string variables 'fullname', 'weapon', 'vision', and integer…
A: A class will be created named "Character" with the given string variables - fullname, weapon,…
Q: Use a class named 'Character' with string variables 'fullname', 'weapon', 'vision', and integer…
A: Implementing given program in C++.
Q: Part A Write a class Bill containing the following attribute: V ID: The Bill number of type int V…
A: Solution: Java Program: import java.util.*; public class Bill { // Declare variables //…
Q: Q1: Write a complete JAVA program that carries out the following tasks: Declare a class Video with…
A: The given problem will be solved using a java program where a class named Video is needed to be…
Q: Assume we have a class called Phone with variables size, weight, type, It has a string array called…
A: i have given an answer in step2.
Q: Write a class named StockPrice. The class constructor should accept an array of stock prices as its…
A: First of all ,you need to create a class .The class name is StockPrice in which you need to create…
Q: Write your class code here data_type1 = DataType(‘Integer’, 1234) print(data_type1.name)…
A: The program is written in Java. Check the screenshot of the program for line indentation. Please…
Q: Part-1: Write a program that includes in its class the following methods: 1. A method named print…
A: Here is the java code: See below step for code.
Q: Consider the following class named Shirt public class Shirt { private int size; private double…
A: The solution to the given problem is below.
Q: 3.2.6 Create a data type Locationthat represents a location on Earth using latitudes and longitudes.…
A: from math import cos,sin,acosclass Location: ROE = 6400 # radius of earth # constructor def…
Q: I. Using the dialog boxes in the JOptionPane class, write a program that calculates and prints the…
A: PROGRAM: //Importing header import javax.swing.JOptionPane; //Defining class class…
Q: TASK Write a program that grades students' exam. The exam has 20 multiple choice questions. Here are…
A: class StudentExam{ private: static char key[]; char ans[21],missed[21];…
Q: C++ Write a program that converts a number entered in Roman numerals to a positive integer. Your…
A: Given, Roman Numerals Positive Integers M 1000 D 500 C 100 L 50 X 10 V 5 I 1…
Q: Program 1 Design a class named Stocks that contains: Private Data Members: A string data field…
A: #include <iostream>#include <iomanip>#include <cmath>using namespace std; class…
Q: Question 01: Write a Program to design a class complex to represent complex numbers. Create an input…
A: As per expert guidelines , when there are unrelated multiple questions, I am supposed to answer the…
Q: 1. Calculate the test averages 2. Return test averages 3. Calculate grades, 4. return grades. 5. And…
A: All the solution code is below:
Q: Question 2 Design a class called Flower with the instance variables so that after executing the…
A: Design a class called Flower with the instance variables so that after executing the following line…
Q: Imagine some publishing company that markets both book and audio cassette versions of its works.…
A: code in c++
Q: Program 1 Design a class named Stocks that contains: Private Data Members: A string data field…
A: import java.util.*;import java.lang.*;import java.io.*; class Stocks{ private String symbol; private…
Q: C#. Using the Automobile class you created Chapter 10, Programming Exercise 5A
A: using System; using System.Collections.Generic; using static System.Console; class AutomobileDemo2 {…
Q: Part (1) Create a class named Item, that includes two private members: Type (String), and…
A: Given: Part (1) Create a class named Item, that includes two private members: Type (String), and…
Q: class gene { public: gene( ); gene(string n, string cl); string get_genename( ); //required…
A: (a) class gene{ public: gene() { name=""; chromosomal_location=""; }…
Q: Assume a class named Employee is defined. To create an array of size 10 of type Employee, the…
A: Syntax for defining array of objects : ClassName[ ] obj = new ClassName[ array_length ];
Q: Question 11 View the following class definition then answer the question that follows. class Date…
A: At the object creation, 4 values are passed i.e day=01, month =04 , year = 2022 and descr= important…
Q: Create a class named Problem1, and create a main method, inside the main method prompt the user to…
A: Code in java for first 3 sub parts: import java.util.*;public class Problem1{ //get max function…
Q: Create a class calculate that uses two separate functions:-a function to multiply two float numbers…
A: According to the question below the Complete Program: Programming language is not mention so i am…
Q: Program #5: a. Create a class named Circle with fields named radius, diameter, and area. Include a…
A: Actually, the code has given below:
Q: Create a class called Invoice that a hardware store might use to represent an invoice for an item…
A: Java program: //creating class Invoiceclass Invoice { // declaring instance variables String…
Q: QUESTION 18 Which of the following is a correct way to declare an array in Java? int arr new int[5];…
A: Dear Student, The correct way to declare an array in java is int [] array = new int[5]; All the…
Q: 8- Create an Instance of the following class and call its methods. class Exam int grade: publie:…
A: Answer: Code: #include <bits/stdc++.h>using namespace std;class Exam{ int grade; //…
Q: Use a class named 'Character' with string variables 'fullname', 'weapon', 'vision', and integer…
A: Hey. I have written the complete and correct code in step 2 and the output for corresponding code is…
Q: Exercise 3 Complete the following source code by include the default constructor for its class. The…
A: Find the required code given as below and output :
Question is in attatchment. Thanks!
Step by step
Solved in 5 steps with 4 images
- Java a) You are writing a method named getAverage that runs in the main class and is called by the main method. Its only parameter is a 2D double array named values, and it returns a double that is the average of all the values stored in it. Write the complete method header for this method. Include the opening brace for the method. b) Given a String variable named firstName that has been declared and initialized, write the complete statement needed to make firstName all lowercase.In previous chapters, you have created programs for the Greenville Idol competition. Now create a Contestant class with the following characteristics: The Contestant class contains public static arrays that hold talent codes and descriptions. Recall that the talent categories are Singing Dancing, Musical instrument, and Other. The class contains an auto-implemented property that holds a contestants name. The class contains fields for a talent code and description. The set accessor for the code assigns a code only if it is valid. Otherwise, it assigns I for Invalid. The talent description is a read-only property that is assigned a value when the code is set. Modify the GreenvilleRevenue program so that it uses the Contestant class and performs the following tasks: The program prompts the user for the number of contestants in this years competition; the number must be between 0 and 30. The program continues to prompt the user until a valid value is entered. The expected revenue is calculated and displayed. The revenue is $25 per contestant. The program prompts the user for names and talent codes for each contestant entered. Along with the prompt for a talent code, display a list of the valid categories. After data entry is complete, the program displays the valid talent categories and then continuously prompts the user for talent codes and displays the names of all contestants in the category. Appropriate messages are displayed if the entered code is not a character or a valid code.Write a class that for running the following codes: [You are not allowed to change the code below] #Write your class code here data_type1 = DataType(‘Integer’, 1234) print(data_type1.name) print(data_type1.value) print('=====================') data_type2 = DataType(‘String’, ‘Hello’) print(data_type2.name) print(data_type2.value) print('=====================') data_type3 = DataType(‘Float’, 4.0) print(data_type3.name) print(data_type3.value) Output: Integer 1234 ===================== String Hello ===================== Float 4.0 Subtasks: Create a class named DataType with the required constructor. Assign name and values in constructor according to the output.
- The local Driver’s License Office has asked you to write a program that grades the written portion of the driver’s license exam. The exam has 20 multiple choice questions. Here are the correct answers: B D A A C A B A C D B C D A D C C B D A A student must correctly answer 15 of the 20 questions to pass the exam. Write a class named DriverExam that holds the correct answers to the exam in an array field. The class should also have an array field that holds the student’s answers. The class should have the following methods: • passed. Returns true if the student passed the exam, or false if the student failed • totalCorrect. Returns the total number of correctly answered questions • totalIncorrect. Returns the total number of incorrectly answered questions • questionsMissed. An int array containing the question numbers of the questions that the student missed Demonstrate the class in a complete program that asks the user to enter a student’s answers, and then displays the…Java please Create a program to enter grades and calculate averages and letter grades. Need a class which will contain: Student Name Student Id Student Grades (an array of 3 grades) A constructor that clears the student data (use -1 for unset grades) Get functions for items a, b, and c, average, and letter grade Set functions for items a, n, and c Note that the get and set functions for Student grades need an argument for the grade index. Need another class which will contain: An Array of Students (1 above) A count of the number of students in the use You need to create a menu interface that allows you to: Add new students Enter test grades Display all the students with their names, ids, test grades, average, and letter grade Exit the program Add comments and use proper indentation. Nice Features: I would like that system to accept a student with no grades, then later add one or more grades, and when all grades are entered, calculate the final average or grade. I would like…Case Problem 1 - In previous chapters, you developed classes that work with catering event information for Carly’s Catering. Now modify the Event and EventDemo classes as follows: Modify the Event class to include an integer field that holds an event type. Add a final String array that holds names of the types of events that Carly’s caters—wedding, baptism, birthday, corporate, and other. Include get and set methods for the integer event type field. If the argument passed to the method that sets the event type is larger than the size of the array of String event types, then set the integer to the element number occupied by other. Include a get method that returns an event’s String event type based on the numeric event type. To keep the EventDemo class simple, remove all the statements that compare event sizes and that display the invitation Strings. Modify the EventDemo class so that instead of creating three single Event objects, it uses an array of three Event objects. Get data for…
- Part (1) Create a class named Item, that includes two private members: Type (String), and Price(double). The Item class should also include: one set method, two get methods and default constructor to initialize Type to “None” and Price to 0.0. Part (2) Write a static method named findAvg that takes as parameter an array of type Item. The method should find and output the average price of all items in the array. The method prototype is: public static void findAvg (Item [] list) Write the main method to do the following: Declare an array of type Item of size 5; Ask the user to enter type and price for each item in the array Call the findAvg method to output the average price of all items.Create a class named Taxpayer. Data fields for Taxpayers include Social Security number(use an int for the type, and do not use dashes within the Social Security number) and yearly gross income. Methods include a constructor that requires values for both data fields, and two get methods that return each of the data field values. B。 Write a program that declares an array of 10 Taxpayer objects. Set each Social Security number to 999999999 and each gross income to zero. Display the 10 Taxpayer objects C. Modify your program so each Taxpayer has a successive Social Security number from 1-10 and gross incomes that range from 10000 to 100000, increasing by 10000 for each successive Taxpayer.The local Driver’s License Office has asked you to write a program that grades the written portion of the driver’s license exam. The exam has 10 multiple-choice questions. Here are the correct answers: 1. B 2. D 3. A 4. A 5. C 6. A 7. B 8. A 9. C 10. D A student must correctly answer 7 of the 10 questions to pass the exam. Write a class named DriverExam that holds the correct answers to the exam in an array field. The class should also have an array field that holds the student’s answers. The class should have the following methods: • passed. Returns true if the student passed the exam, or false if the student failed. • totalCorrect. Returns the total number of correctly answered questions. • totalIncorrect. Returns the total number of incorrectly answered questions. • questionsMissed. An int array containing the question numbers of the questions that the student missed, i.e. answered incorrectly. Test the class in a separate class, DriverTest , that asks the user to enter a student’s…
- C#. Using the Automobile class you created Chapter 10, Programming Exercise 5A as a base, derive a FinancedAutomobile class that contains all the data of an Automobile, plus the following field: AmtFinanced - The amount financed (a double) Override the parent class ToString() method to include the child class’s additional data. Create a program named AutomobileDemo2 that contains an array of four FinancedAutomobile objects. Prompt the user for all the necessary data, and do not allow duplicate ID numbers and do not allow the amount financed to be greater than the price of the automobile. Sort all the records in ID number order and display them with a total price for all FinancedAutomobiles and a total amount financed. For example, the output should be in the following format: Summary: FinancedAutomobile 1 2017 Honda Price is $26,000.00 Amount financed $12,000.00 FinancedAutomobile 4 2019 Honda Price is $36,000.00 Amount financed $0.00 FinancedAutomobile 5 2016 Toyota Price is…Using the Automobile class you created Chapter 10, Programming Exercise 5A as a base, derive a FinancedAutomobile class that contains all the data of an Automobile, plus the following field: AmtFinanced - The amount financed (a double) Override the parent class ToString() method to include the child class’s additional data. Create a program named AutomobileDemo2 that contains an array of four FinancedAutomobile objects. Prompt the user for all the necessary data, and do not allow duplicate ID numbers and do not allow the amount financed to be greater than the price of the automobile. Sort all the records in ID number order and display them with a total price for all FinancedAutomobiles and a total amount financed. For example, the output should be in the following format: Summary: FinancedAutomobile 1 2017 Honda Price is $26,000.00 Amount financed $12,000.00 FinancedAutomobile 4 2019 Honda Price is $36,000.00 Amount financed $0.00 FinancedAutomobile 5 2016 Toyota Price is $30,000.00…Using the Automobile class you created Chapter 10, Programming Exercise 5A as a base, derive a FinancedAutomobile class that contains all the data of an Automobile, plus the following field: AmtFinanced - The amount financed (a double) Override the parent class ToString() method to include the child class’s additional data. Create a program named AutomobileDemo2 that contains an array of four FinancedAutomobile objects. Prompt the user for all the necessary data, and do not allow duplicate ID numbers, and do not allow the amount financed to be greater than the price of the automobile. Sort all the records in ID number order and display them with a total price for all FinancedAutomobiles and a total amount financed. For example, the output should be in the following format: