CSE LAB APEX Test Class - Salesforce Please Desgin the Apex Test Class to solve the below problem public with sharing class MyFirstClass { // Variable to store the values to perform the multiplication logic static Integer a = 5; static Integer b = 9; public static Integer productOfTwoNumbers; public static void multipicationOfTwoNumber() { //Product of the two Numbers productOfTwoNumbers = a * b; }
Q: 3. Term by CodeChum Admin Construct a class called Term. It is going to represent a term in…
A: I've established a class here called Term. I made a function Object() { [native code] } for this…
Q: True or false A class can have self-referential data members
A: Because the data members in a class can never refer to own class type. This is not possible because…
Q: Define an iterator class named PrimeIterator foriteratingprime numbers. The constructor takes an…
A: PROGRAM: //Adding the required header file import java.util.Iterator; //Defining the class public…
Q: Song Equality Define a public class named Song. The Song constructor should accept a String name,…
A: ALGORITHM:- 1. Create class Song. 2. Create 3-argument constructor & override equals method in…
Q: Ql: Class called (num) and an object of this class called (numl).This class contains two data…
A: Program in C++ language :- #include<iostream> using namespace std; //definition of num class…
Q: (Triangle class) Design a new Triangle class that extends the abstract Geometricobject class. Draw…
A: Solution - Programming language used: Java All necessary comments are included in program code.…
Q: Create a class time24, each object is a value represented the time of day in the form hours, minutes…
A: A C++ program that satisfies the given criteria is as follows, File name: “main.cpp” #include…
Q: 6. A class should take any number as an argument but no other data types. Which code does this? а.…
A: Explanation is given below:
Q: The following is a definition of class Example:class Example{public:Example( int y = 10 ): data( y…
A: the answer is an given below :
Q: PROGRAMMING LANGUAGE :C++ QUESTION; You need to store hiring date and date of birth for Managers…
A: Composition in C++- In real life, complex structures are often constructed from smaller, simpler…
Q: Define and implement class Employee. This class should contain the following fields: first name,…
A: For designing the java program with the given specifications, do the following: Create class…
Q: Write a program that implements the algorithm delimiterMatching() seen in class.
A: public class delimiterMatching { public static void main(String a[]){ delimiterMatching…
Q: Exercises abstract class • Design a new Triangle class that extends the abstract GeometricObject…
A: Program Approach: Defining the necessary packages Defining the Base class Declaring the method…
Q: Machine Problem: Implement Polymorphism to compute the wages of regular and contractual employees.…
A: Algorithm: Start Create a class Employee with attributes ID, Name, jobPosition, jobStatus, rate,…
Q: Python Programming- Invoice Class Introduction: Requires creating classes and instantiating…
A: Algorithm: Start the program. Create a class “Invoice”, Initialize the necessary variables. Define…
Q: APEX Test Class - Salesforce Please Desgin the Apex Test Class to solve the below problem
A: The answer is
Q: Fill-in-the-Blank Normally a class’s _______________________________ are declared to be private and…
A: The answer is : member variables member functions.
Q: We will create a class of Exponent. Create a class named Exponent with this attributes: base type…
A: #include <iostream>#include <math.h>using namespace std; class Exponent{ private:…
Q: JAVA PROGRAMMING: Lesson – Overloading Constructors Create a class named House that includes data…
A: Algorithm: Step 1: Create House.java with revenue and occupants as flexibility Step 2: List the…
Q: Complete method __init__ in the following class. (It's only missing an assignment to a radius…
A: Here in the init method, we have an integer type argument whose value will be passed at the time of…
Q: python Cylinder class: Instance variables: Make instance variables appropriately to accomplish the…
A: Python used to answer this question
Q: ChildClass childd : double childc : char + ChildClass (parentD : double, parentC : char, childd :…
A: Programming instructions: Create ParentClass. In the ParentClass, create required variables.…
Q: rite a OOP C++ program that declares two classes. The parent class is called Simple that has two…
A: #include <iostream>using namespace std;//parent classclass Simple{protected: int num1;…
Q: Interactive Mathematics Lab is working on computing new formulas for mathematical calculations. You…
A: The required code is as follows:-
Q: Design a class that implements the basic properties of a die. Consider the definition of the…
A: Here I have defined the functions of the class die. Next, in the main method, I have taken input…
Q: Implement the design of the Author class so that the following output is produced:
A: Solution: Programming language used: Python Program Code in Python: (Note: all necessary comments…
Q: A counter variable is normally used in a program to keep track of the current count value.Create…
A: Hey there, I am writing the required solution for the above mentioned question. Please do find the…
Q: Quadratic equations The form of a quadratic equation is ax2 + bx + c = 0. Write a program that…
A: package solveequation;public class Complex{ //two double variable to represent real and imaginary…
Q: verload the assignment operators (=) for Distance class. Your operator must be able to do…
A: Given Overload the assignment operators (=) for Distance class. Your operator must be able to do…
Q: APEX Test Class - Salesforce Please Desgin the Apex Test Class to solve the below problem…
A: Given: Please Desgin the Apex Test Class to solve the below problem public with sharing class…
Q: Create a program that exhibits inheritance. Procedure:
A: Solution: Programming language used: Java Program in Java: (Note: all necessary comments are…
Q: (RationalNumber Class) Create a class RationalNumber (fractions) with these capabilities:a) Create a…
A: Coded using C++.
Q: C# language Write a program to create a class employee, it consist of ID, name, department and…
A: We need to create an Employee class that has 4 data members- ID, name, department, address. This…
Q: Problem: Employee and ProductionWorker Classes Write a python class named ProductionWorker that is…
A: The program is given below written in python- #class employeeclass Employee : #constructor for the…
Q: The program will ask the user for some basic information (Name, Age, Address, etc.) then the program…
A: import java.util.*; publicclass Main { publicstaticvoid main(String args[]){ String arr[][] =…
Q: Invoicing.java Create a class named Invoicing (no instance private data fields) that includes three…
A: Here is the detailed explanation of the program
Q: #pyhton programing topic: Introduction to Method and Designing class Method overloading &…
A: Here, we created a class Calculator. And we have 4 methods, namely add, subtract, multiply and…
Q: Hands-on Activity People in School Objective: At the end of the activity, the students should be…
A: In the question given above, the UML diagram for the class Faculty doesn't include any setter method…
Q: ABC Company helps its clients to find a quick and easy analysis for better investment decisions. It…
A: In a Java class, a copy function Object() { [native code] } creates an object by copying another…
Q: Part 2 - Syntax Errors and Troubleshooting The code below has many syntax (and other) errors.…
A: The given problem is related to Java programming where the lab program has many errors and the…
Q: Timer Class Concepts tested: Classes 1) Write a class called Timer that models a stopwatch…
A: According to the information given:- We have to create timer class on the basis of instruction…
Q: The Temperature class is an abstract class with two abstract methods. Create the Conversion class…
A: Use if conditional statements to check the temperature type and invoke respective method and while…
Q: Create a class Student with data members age and marks, both of type integer. Provide a…
A: C++ Program: #include <iostream>#include <string>#include <exception> using…
Q: 3. Using the given code answer the given questions in the box. Public class MyClass Accessor: {…
A: An Accessor method is known as a get method or a getter. A Mutator method is known as a set method…
Q: (Triangle class) Design a new Triangle class that extends the abstract GeometricObject class. Draw…
A: Given:
Q: PROGRAMMING LANGUAGE: C++ SUBJECT: OOP Task: Suppose you have a class Rectangle with data…
A: #include <iostream>using namespace std; //Rectangle class declarationclass Rectangle{ int…
Q: Consider the following pseudocode, then write the pseudocode for mainline. class Weapon…
A: Instance variables are the variables that are independent for every object that we generate The…
CSE LAB
APEX Test Class - Salesforce
Please Desgin the Apex Test Class to solve the below problem
public with sharing class MyFirstClass {
// Variable to store the values to perform the multiplication logic
static Integer a = 5;
static Integer b = 9;
public static Integer productOfTwoNumbers;
public static void multipicationOfTwoNumber()
{
//Product of the two Numbers
productOfTwoNumbers = a * b;
}
Step by step
Solved in 2 steps with 1 images
- 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…Define 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.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 options
- 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…: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…Term by CodeChum Admin (JAVA CODE) Construct a class called Term. It is going to represent a term in polynomial expression. It has an integer coefficient and an exponent. In this case, there is only 1 independent variable that is 'x'. There should be two operations for the Term: public Term times(Term t) - multiplies the term with another term and returns the result public String toString() - prints the coefficient followed by "x^" and appended by the exponent. But with the following additional rules: if the coefficient is 1, then it is not printed. if the exponent is 1, then it is not printed ( the caret is not printed as well) if the exponent is 0, then only the coefficient is printed. Input The first line contains the coefficient and the exponent of the first term. The second line contains the coefficient and the exponent of the second term. 1·1 4·3 Output Display the resulting product for each of the test case. 4x^4
- Interactive Mathematics Lab is working on computing new formulas for mathematical calculations. You are working as research programmer and your duty to provide programming support to the researchers working in the lab. One of the researchers is stuck in evaluation Thevenin’s Theorem, he asked you to evaluate the equation using object-oriented concepts. Your task is to create a class Thevenin with ● 4 data members voltage (VTH), Thevenis Resistance (RTH), Load Resistance (RL) & Total Current (IT) ● A member function input ( ) to take the values of the data members ● Design a friend function to calculate the value of Total Current Hint : IT=Vth/(Rth+RL). Subject:(OOP)python question Design BDTeam class and AusTeam class which inherit from CricketTeam class so that the following code provides the expected output.You can not change any of the given code. Do not modify the given parent class.Note:add_player() method in both child classes should work for any number of parameters and assume parameters will be even numbers.class CricketTeam: def __init__(self, name, ranking, continent): self.name = name self.ranking = ranking self.continent = continent def add_player(self, *info): pass def __str__(self): s = f"Name: {self.name}\nRanking: {self.ranking}\nContinent: {self.continent}" return s# Write your codes here.# Do not change the following lines of code.bangladesh = BDTeam("Bangladesh", 7, "South Asia", 1)bangladesh.add_player("Mustafiz", "Bowler", "Mashrafee", "Bowler", "Shakib", "All Rounder", "Tamim", "Batter", "Mahmudullah",…JAVA PROGRAM ASAP *********** THIS PROGRAM MUST WORK IN HYPERGRADE AND PASS ALL THE TEST CASES. Please create a program BECAUSE IT IS. MY HOMEWORK ASSIGNMENT with the following parts which are down below: The left index is inclusive and the right index is exclusive. 1. public static void bubbleSort(int[] array, int left, int right) { // your code here } 2. public static void insertionSort(int[] array, int left, int right) { // your code here } 3. public static void selectionSort(int[] array, int left, int right) { // your code here } Test Case 1 Please enter a space separated list of numbers to sort or type QUIT to exit:\n4 3 2 1ENTERSorting first half of the array using Bubble Sort algorithm:\n3 4 2 1\nSorting second half of the array using Bubble Sort algorithm:\n4 3 1 2\nSorting the array using Bubble Sort algorithm:\n1 2 3 4\nSorting first half of the array using Insertion Sort algorithm:\n3 4 2 1\nSorting second half of the array using Insertion…
- in c++ Define a new class named “Student” that must inherit from the given User class. This class manages student info: id (integer), name (string) and gpa (double). It must prevent the creation of a Student object with a negative ID or a GPA that is not between the range of 0.0 and 4.0 by generating a BadValueException error. This class will provide at least the following methods: toString method to return a string representation of the Student object in the format of “ID( <id> ) NAME( <name> ) GPA( <gpa> )” Such as ID(1234) NAME(John Smith) GPA(4.00) Note: the GPA must have 2 decimal places. isGPAGreater method that compares its gpa with another student’s gpa. It returns true if its gpa is greater than the other and false otherwise.C++ Create a class Fractions with these capabilities:a) Create a constructor that prevents a 0 denominator in a fraction, reduces or simplifies fractions that are not in reduced form and avoids negative denominators.b) Overload the addition, subtraction, multiplication and division operators for this class.c) Overload the relational and equality operators for this class. Implement this class with example outputs for A, B and C. Design: Code: Output:i will upvotes unique answer plzz (Use language OOP in c++) Create a class Student with data members age and marks, both of type integer. Provide a parameterized constructor and a set member function to set the data members. The age should be a positive number between 15 and 40 while the marks should be between 0 and 100. Create a class InvalidRange as exception handler of the Student class. Add two private data members (a string and an integer) to theclass InvalidRange. Provide appropriate constructor and get methods for the data members. The string should store the name of the function throwing the exception while the integer should store the invalid value the user has supplied. The student class should throw an exception if any of its member functions attempts to assign an invalid value to the data members. In the main program, create objects of class student, assign valid/invalid values to the data members and catch the exceptions accordingly. Extend the program to have two…