I need to figure out how to call a method that is located in a different class. For example, I am trying to make a tax calculator that multiplies a payers income by a corporate rate. However, I cannot figure out how to call the income method. Nothing I have tried is working. Is there any chance you can guide me? I am just trying to make this equation work. Is there something else that is stopping this from working?
Q: Average Restaurant Rating and Number of Stars - A restaurant receives numeric scores of 0-10 from…
A: IPO Diagram Code Output
Q: find the total and average in my code but in lines 18 and 20, I'm a bit confused on how to keep out…
A: In order to find the valid sum and average of numbers we need to modify the above code. The correct…
Q: HEAD 40H Į NULL X HEAD Į 30H A 20H 20H 20H C 20H 40H 10H Y 10H 10H B 40H TAIL 10H Į 20H Z TAIL Į 40H…
A: As per the given information, we have 2 linked lists. One is a double-linked list and another one is…
Q: DFDs are becoming more popular as a data and processing paradigm. Have you considered the various…
A: What is DFD? A data flow diagram (DFD) is a graphical or visual depiction that describes how data is…
Q: Explain basic terminologies in network security.
A: Basic Terminologies in Network Security There are many security concepts that need to be addressed…
Q: The Abstract Data Type (ADT) is a person or thing. What benefits can ADTs really offer? How does the…
A: Introduction: ADT: Mathematically speaking, abstract data types (ADTs) are utilized to characterize…
Q: Write Algorithm to Sift an element Input: a labelled branching A (with value A0); an element g;…
A: Algorithm to Sift an elementInput: a labelled branching A (with value A0); an element g;Output: an…
Q: What are the categories of computer security?
A: Categories of computer security Application security Information security Network security Endpoint…
Q: Which is preferred when it comes to linking the CPU to memory? Thanks. How did you arrive at this…
A: How did you decide that a synchronous bus between the CPU and memory was superior? To learn: Is it…
Q: Create a LWC component to display the output. You can create the dummy data in JS file. HelloForEach…
A: Create a LWC component to display the output. You can create the dummy data in JS file. HelloForEach…
Q: The program should have an array of 12 structures to hold weather data for an entire year. When the…
A: #include <iostream>using namespace std;struct weather{ double total; double high;…
Q: What purpose does the remote interface serve, and what requirements must it fulfill?
A: Introduction: When implementing RMI, the following remote interfaces must be used: In RMI, a remote…
Q: Mobile Applications and Intelligent Systems are two of the most advanced information system types…
A: Information system : Computers, tablets, cellphones, hard drives, and other gadgets are examples of…
Q: Create a list of the many types of DNS records that exist. Provide examples and an explanation of…
A: DNS(Domain name system) Record: We require DNS system and records to keep the internet functioning…
Q: What does this mean? Unable to copy files into table. Number of columns in file (3) does not match…
A: Answer: It looks like you have a header row in your file. Have you tried using the optional…
Q: What sets data structures apart from other types of information?
A: Introduction: Data Structures store, manage, and organize data so it may be utilised efficiently. A…
Q: What distinguishes Doom from other video games?
A: Video games: Id Software created the 1993 first-person shooter (FPS) game Doom for MS-DOS. The…
Q: Running on a particular treadmill you burn 4.2 calories per minute. Write a program that uses a…
A: The solution is given in the below steps for your reference.
Q: Write the recursive version of the function filter which returns a list and takes in • f - a…
A: I have given answer below.
Q: We want our DSL to be non-invasive so that we may rely on the benefits of inheritance. The method we…
A: Inheritance is one of the concept of object oriented programming in which a child class inherit all…
Q: Do you agree that "there is no concept of client and server sides of a communication session" in a…
A: P2P (or peer-to-peer) is a file-sharing technique that is used in the field of computer networking.…
Q: Q.4 Use polyalphabetic ciphers to encrypt plain VERY HAPPY AND BEAUTIFUL GIRL" use key 'ANOTHER'…
A:
Q: Question 1: Use Python (Class Average: Writing Student Records to a CSV File) An instructor…
A: Python The interpreter processes Python while it is being used. Before running your software, you…
Q: thank you! but what is the answer?
A: Here we have given the explanation of the previous answer. It states the following options in step 2…
Q: Suppose that a program runs for a while, then prints "Hit any key to continue," waits for a key to…
A: Real time - It is basically the actual time taken that is it is difference between the start and…
Q: Convert UML class diagrams to Java code You are required to convert the UML class diagrams shown…
A: Required language is Java:
Q: Files Class Activity Write a program to write your first name (hard coded) to the screen and…
A: HERE WE WRITE THE PROGRAM IN C LANGUAGE:- C LANGUAGE INTRODUCTION:- A general-purpose programming…
Q: If you need to announce a Linked List Node structure for recording two data member with Name,…
A: Structures are used to club multiple datatypes under a single data structure in C and C++;
Q: Understand the actual allocation of the element of Linked List in main memory. ○ a. It doesn't need…
A: Answer: a. It doesn't need to continuously allocation but it needs to follow up the sequence of the…
Q: The following is a multiplication problem in traditional base ten notation. Each letter represents a…
A: The answer for the above mentioned question is given in the below step for your reference.
Q: Given a list of words, write a program to find the longest word made of other words in the list.
A: This problem seems complex, so let's simplify it. What if we just wanted to know the longest word…
Q: Construct a truth table for (p→q)^(q→p)
A: Dear student, the answer is provided below.
Q: When explaining the DNS, be sure to mention authoritative and root servers, iterated and…
A: the domain name system, or DNS. The World wide web phone book is the Domain Name System (DNS). To…
Q: This question concerns the field GF(256). The modulus is P(x) = x³ + x For computing inverses in…
A: The answer for the question is given in the below steps for your reference.
Q: it is possible What is the correct sequence of Stack operations (push and pop)? (multiple choice…
A: The answer is
Q: Write a short essay (roughly 250 words) about some topic related to data communication technology…
A: According to the information given:- We have to define a short essay related to data communication…
Q: Prove or disprove that for any x ∈ N, x(x+1)/2 ∈ N (where N = {0, 1, 2, 3, ….}
A: Hello student
Q: Use a software program or a graphing utility to solve the system of linear equations. (If there is…
A: Linear equation : An equation is said to be linear if the maximum power of the variable is…
Q: Find DFAs that accept the following languages. 1. L(ab(a + ab) ∗ (a + aa)) 2. L(ab∗a ∗ ) ∪ L((ab)…
A: DFAs An algorithm for navigating or searching through tree and graph data structures is called…
Q: Explain the link-state flooding process? How long does it last and what is the end result of this…
A: According to the information given:- We have to define the link-state flooding process? How long…
Q: Write a program sorta that sorts and prints its arguments. sorta takes zero or more arguments, sorts…
A: C Programming which refers to the object oriented programming languages. C programming language…
Q: text Q.4 Use polyalphabetic ciphers to encrypt plain VERY HAPPY AND BEAUTIFUL GIRL" use key…
A: Q.4 Use polyalphabetic ciphers to encrypt plain text SHE IS VERY HAPPY AND BEAUTIFUL GIRL" use key…
Q: You have an String and your task is to find the minimum number of cuts that is required to make…
A: Required: You have an String and your task is to find the minimum number of cuts that is required to…
Q: for incorrect. Do ri
A: From question Using banker's algorithm to define the states safe or note:
Q: Improving the memory system for the above so that each Load instruction takes just 25 CPI would…
A: Let's see the answer:
Q: Hi could you explain which line of code is doing what? I am new to python and need help figuring out…
A: program that takes any number of integers as input, and outputs the average and max. Ex: If the…
Q: Define Internet of Things (IoT). What are some of the future projects and applications coming out of…
A: The internet of things, or IoT, is a networked system of interconnected computing devices,…
Q: Please do NOT answer the question, just tell me what I would put in the SQL querey for each question…
A: SQL: SQL stands for Structuted Query Language. It is used to access and manipulate database. It is…
Q: Q.12 What is passive and active attacks in information security explain with suitable example.
A: Answer the above question are as follows
Q: is no concept of session" in a P2P file-sharing program? Both good Do you agree communication and…
A: A P2P file-sharing programme has no idea of the client and server sides of a communication session,…
I need to figure out how to call a method that is located in a different class. For example, I am trying to make a tax calculator that multiplies a payers income by a corporate rate. However, I cannot figure out how to call the income method. Nothing I have tried is working. Is there any chance you can guide me? I am just trying to make this equation work. Is there something else that is stopping this from working?
Step by step
Solved in 2 steps
- The BankAccount class described below is used to represent a personal savings account with a yearly interest rate, (represented as a percentage, e.g., a 7% rate is represented by .07). The interest is applied monthly, (i.e., at the end of each month 1/12 of the interest is deposited into the account). public class BankAccount { public BankAccount(double rate) public BankAccount(double initBal, double rate) public double getBalance() public double getIntRate() public void setIntRate(double rate) public void deposit(double amount) public void withdraw(double amount) public void addMonthsInterest() private double balance; private double intRate; } Suppose a bank offers to its special customers a new type of savings account, called a “Credit Account”, that allows the customer to withdraw extra money if needed, so that the account balance is allowed to be negative at some times. These accounts award interest at the end of every month, as long as the balance is positive. If the…:Define and implement class Employee. This class should contain the following fields: first name, last name, employee id, hourly pay. This class should contain getters and setters for all its attributes. This class also needs at least one constructor. Implement method computePay() in this class. This method should accept an integer number of hours the employee worked as an input argument and return a floating point value indicating the pay the employee earned. If the number of hours is invalid (e.g. a negative number) this method should throw NumberFormatException. If the number of hours is over 40 then this method should throw a custom exception named TooManyHoursWorkedException. Remember that you will have to define your own exception class for this. Save this class and its definition into a file named Employee.java. Define and implement class EmployeeTest.This class should implement main() method. In the body of the main() method you should create an instance of Employee with the…Java Questions - (Has 2 Parts). Based on each code, which answer out of the choices "A,B,C,D,E" is correct. Each question has one correct answer. Thank you. Part 1 - 3. Given the following code, the output is __. class Base { private int x = 5; }class Derived extends Base { x = 6; }public class Sample { public static void main(String[] args) { int x = 7; Derived d1 = new Derived(); System.out.print(d1.x); }} A. 0B. 5C. 6D. 7E. Error message Part 2 - 4. A class Animal has a subclass Mammal. Which of the following is true? A. class Animal extends Mammal { }B. class Mammal extends Animal { }C. class Animal implements Mammal { }D. class Mammal implements Animal { }E. class Mammal { Animal a1 = new Animal(); }
- In Java Write a bank account program that handles bank account balances for an array of bank accounts. There aretwo types of bank accounts ─ checking and savings. Use this UML class diagram:BankAccountChecking SavingsImplement the following classes and methods.BankAccount class:Instance variable:balancedeposit method ─ add the given amount to the current balance.Withdraw method ─ subtract the given amount from the current balance. Don’t allow the balance togo below zero. If the balance does go below zero, change the balance to zero.display method ─ This must be an abstract method.Checking class:No new instance variables.writeACheck method ─ subtract the given amount from the current balance and then subtract anadditional $1 as part of a service fee.display method ─ print the type of account, checking, and then the balance (with standard currencyformat). Study the output for details.Savings class:Instance variable:intRate (interest rate)addInterest method ─ calculate the interest by…Java Questions - (Has 2 Parts). Based on each code, which answer out of the choices "A,B,C,D,E" is correct. Each question has one correct answer. Thank you. Part 1 - 5. In Java, inheritance uses __ relationship. A. is-aB. part-ofC. has-aD. member-ofE. None of the options Part 2 - 6. Given the following code, the output is __. class Apple { int x = 15; }class Banana extends Apple { int x = 25; }public class Sample { public static void main(String[] args) {Apple a1 = new Banana(); System.out.println(a1.x); }} A. Compiler errorB. 25C. 15D. 0E. None of the optionsJAVA /** * This class contains an example of an enumerated type. * The task is to: * 1. Run the code and understand what it does. Then, * Uncomment the commented code section and understand and briefly explain * what the alternate definition of the enum does. */ public class EnumDemo { public enum Day {MON, TUE, WED, THU, FRI, SAT, SUN}; /* //This is an enhanced enum for Day. public enum Day { MON("1"), TUE("2"), WED("3"), THU("4"), FRI("5"), SAT("6"), SUN("7"); private String display; private Day(String display){ this.display = display; } public String toString(){ return display; } }*/ public static void main(String[] args) { Day d = Day.MON; System.out.println("We always start from day: " + d); // enum is printed as "1" or "MON" depending on enum switchDemo(d); d = Day.WED; System.out.println("Then it is day: " + d); switchDemo(d); System.out.println("\nNo!, it goes like this... \n"); for (Day a : Day.values()) { System.out.println("Day " + a); switchDemo(a); } } public static…
- mport java.util.Scanner; public class ParkingCharges { // function to calculate the basic charge using the asked hours static double getBasicCharge(int hours) { if (hours >= 7 && hours <= 8) return 5.50; else if (hours >= 5 && hours <= 6) return 4.50; else if (hours >= 2 && hours <= 4) return 4.00; return 3.00; } // function to return the amount to subtract based on local living and OAP static double getDiscount(String isLocal, String isOAP) { if (isOAP.equals("Yes") && isLocal.equals("Yes")) return 2.0 + 1.0; else if (isOAP.equals("Yes")) return 2.0; else if (isLocal.equals("Yes")) return 1.0; return 0; } public static void main(String[] args) { // create a new Scanner object Scanner sc = new Scanner(System.in); // prompt the user to ask if they are disabled…IN JAVA PLEASE Child Class: Vegetable Write a child class called Vegetable. A vegetable is described by a name, the number of grams of sugar (as a whole number), the number of grams of sodium (as a whole number), and whether or not the vegetable is a starch. For the Vegetable class, write: the complete class header the instance data variables a constructor that sets the instance data variables based on parameters getters and setters; use instance data variables where appropriate a toString method that returns a text representation of a Vegetable object that includes all four characteristics of the vegetableDefine an iterator class named PrimeIterator foriteratingprime numbers. The constructor takes an argument that specifies the limitof the maximum prime number. For example, new PrimeIterator(23302)creates an iterator that iterates prime numbers less than or equal to 23302. Writea test program that uses this iterator to display all prime numbers less than orequal to 120000.
- Quadratic equations The form of a quadratic equation is ax2 + bx + c = 0. Write a program that solves a quadratic equation in all cases, including when both roots are complex numbers. Remember that the solutions are x = (-b + sqrt(b2 -4ac))/2a and (-b - sqrt(b2 -4ac))/2a For this you will need to set up the following classes: Complex: Encapsulates a complex number. ComplexPair: Encapsulates a pair of complex numbers. Quadratic: Encapsulates a quadratic equation. – Assume the coefficients are all of type int for this example. SolveEquation: Contains the main method. (I give this to you it is shown below) Along with the usual constructors, accessors and mutators you will need the following additional methods: In the Complex class a method called isReal to determine whether a complex object is real or not returning a boolean value. In the ComplexPair class a method bothIdentical that determines if both complex numbers are identical, returning a boolean value. In the…Java - Polymorphism 1.Create a class named “Animal” that has the method sound() which prints “Animals make sound.” 2.Create a class named “Cat”, “Dog”, “Pig”, “Rat” which all extends the “Animal” class. 3.Override the sound() method from Animal. These are the sound of the animals: Cat - prints "*meow meow*" Dog - prints "*barf barf*" Pig - prints "*oink oink*" Rat - prints "*squeak squeak*" 4.Call the sound() methods in the same order as stated in #3.class first { public: void setX(); void print() const; protected: int y; void setY(int a); private: int x; }; Suppose that class second is derived from class first using the statement: class second: private first Determine which members of class first are private, protected, and public in class second.