Modify the Item class to maintain a priority value. This value must also be set in the constructor. private int num; public Item(int num) { this.num = num; } public int GetNum() { return num; }
Q: Compare and contrast Windows Explorer and the Windows command line DIR command in terms of a.…
A: INTRODUCTION: Here we need to compare and contrast Windows Explorer and the Windows command line DIR…
Q: stion Completion Status: QUESTION 5 Jsing the single-cycle processor diagram (given as exam…
A: Instruction: addu $t0, $s0, $s2Rs = 16 (value of register $s0)BusA = 15 (content…
Q: What is a protocol, and why is it significant in the I/O bus world?
A: The input/output bus, abbreviated as the io bus, is the communication link between input and output…
Q: There may be a traceroute software that can help us send datagrams of different sizes to an IP…
A: A computer can read and write in machine language: The Internet Layer of the TCP/IP paradigm…
Q: Create in html a shopping cart.
A: HTML:- HTML is a language, basically, a markup language used to design web pages. Main structure of…
Q: 1. The portion of the process scheduler in an operating system that dispatches processes is…
A: The portion of the process scheduler in an operating system that dispatches processes is concerned…
Q: What is meant by a handshaking protocol, and how does it work?
A: Introduction: Handshaking is the method through which two networking devices establish…
Q: What are the duties of an information security professional?
A: Introduction Information security professionals are responsible for designing, implementing,…
Q: Define the three essential phases of testing that you have experienced when working on a commercial…
A: Introduction: Software testing needs that testers pay careful attention to the tiniest details in…
Q: The purpose of database logs is dual. What exactly are they
A: Log files for databases A database log is a collection of operations that a database management…
Q: What is a mock-up report, and how does it work?
A: Report generator and a mock-up report: Computer-Aided Software Engineering (CASE) tools make it…
Q: List the names of the checked and unchecked exceptions. What is the difference between them? Write…
A: Exception handling is a very important feature to handle the occurring exceptions in Java.
Q: Identify, assess, and control risk as part of risk management.
A: Management of Risk: Risk management identifies, evaluates, and minimizes risks that a corporation…
Q: Will the variable declarations result in a stale variable declaration? Why? "Holm" is the last name…
A: Justification: A variable's declaration tells the compiler: The variable's name, type of value, and…
Q: What are the two main sorts of files, in general? What is the difference between the two types of…
A: computer storage: A file is a computer storage unit where all programs and data are "written" and…
Q: 1. What is parallel computing? Give an example, Information technology
A: Introduction: Parallel computing is a sort of computer architecture in which numerous processors…
Q: For simplicity, let us assume that a file block is located at the address 581132 on the disc. What…
A: In this question we have to understand how the file block are located and stored in the disc. Lets…
Q: Would you allocate newly hired systems analysts to maintenance projects as an IT manager? Why do you…
A: Introduction: An analyst collects, analyses, and applies complicated data in order to create…
Q: Define a repository and explain its role in the system development process.
A: A repository is a centralized storage area for all data and information. A repository is…
Q: What are some potential issues with Mario's system? Why won't Danica have the same issues? In your…
A: Introduction: The Super Mario Effect is defined as "sticking with a task and learning more by…
Q: Could you perhaps explain how and what cloud scalability entails? What are some of the…
A: Introduction: Cloud computing refers to the on-demand availability of data storage and processing…
Q: Assuming the code x = 5 % 2 / 3 * 7 + 4 /2 -6; has been executed correctly, what is the value of…
A: Given Question: To find the value of integer x.
Q: Computer networking How mac address and IP address can be helpful to secure your device on a…
A: Introduction: Why is it necessary to have a Mac address? The following are the advantages and…
Q: 2. What are the new features added for Interfaces in Java 8 and Java 9? Give an example of an…
A: INTRODUCTION: Here we need to tell new features added for interfaces in java 8 and Java 9 and also…
Q: For the File Integrity Monitoring Program, what are the relevant codes of ethics and moral…
A: Change, like the majority of things in life, is unavoidable. The same is true for any organization's…
Q: Assuming the code x =( 2 * 5 / 9 % 3 ) * (x++) - 8 / 5 ; has been executed correctly, what is the…
A: Given Question: To give the value of the integer x.
Q: Are there any more web-based technologies that are being used to facilitate project collaboration?
A: Initiation: To cooperate effectively, members of a team must have complete faith in one another,…
Q: When writing a program, each language has a set of rules that must be followed to the letter. What…
A: Introduction: The syntax of a computer language the collection of rules that determine the…
Q: Computer Science Please create the activity model for stock trade order Hint: verify order, send…
A: Activity model is use for whole activity process
Q: Question 5 Consider the following recognising Finite State Machine (FSM) S3 1,0 1,0 S1 S2 S4 So…
A: Find the answer with explanation given as below :
Q: What are some of the risks associated with a server database migration project?
A: Justification: Data is transferred from one server to another using the server migration method.…
Q: Why is it so important that a backup of drive C isn't kept on a different partition on the same hard…
A: Introduction: Various filesystems may be installed for different types of files thanks to…
Q: def test_func(a,b,c): return (a+b)/c This function is normally designed to be used with three…
A: Find the required code in python given as below and output:
Q: C program to generate 100 random number and assign it to array and print it in 20 in a line
A: logic:- declare an array of size 100. iterate from i=0 to i<100 generate random number and…
Q: 2. Find the regular expression for the following Finite Automaton. For this you are requested to…
A: Given finite automata contains, Set of input alphabets= {a, b} Set of states= {q0, q1, q2, q3, q4,…
Q: Question 8 The complement of the following logical expression z'w'+zw is Blank 1 Blank 1 Add your…
A: Given Question: To find the complement of the given boolean expression.
Q: What could be causing connections to remain in the FIN WAIT 2 state, and how can you resolve this?
A: Hi there, Please find your solution below, I hope you would find my solution useful and helpful.…
Q: Computer fundamentals In this case, multithreading does not outperform a single-threaded solution.
A: Introduction: In functional programming, single threading is widely employed. Multithreading is a…
Q: What is a distributed database? What is a DDBMS?
A: Introduction: This may be important if a database has to be seen by many individuals all over the…
Q: re includes word processing programs, spreadsheet programs, e-mail programs, Web browsers, and game…
A: Introduction Software is a set of instructions needed to carry out a certain task. The software…
Q: Computer networking What is the future of cloud computing?
A: Introduction: Cloud computing is made possible by two technologies: networking and virtualization.…
Q: Finding Errors. Identifying the line/s containing errors that can cause the program not to run.…
A: Dear Student, There is only a initialization or declaration error present in your code. The…
Q: Design a turing machine which would accept the language: L = { ww: w is a subset of {a, b}* }
A: The answer of this question is as:
Q: Explain the elements of a communication systems
A: A communications system, often known as a communications network, is a collection of independent…
Q: How can the combiner approach save network time in the map reduce paradigm? Explain with an example.
A: Solution: How can the combiner approach save network time in the map reduce paradigm? Explain with…
Q: F1= P’ST + PS’T + PST’ + PST + PS’T’ + PS’T + PST’ + PST How would I simplify the logic expression…
A: You need to know some rules of the k-map to simplify logic expression. K- map rules First identify…
Q: When utilising recursion to solve a problem, why does the recursive function have to call itself to…
A: When do I need to utilize recursion: Recursion is designed to solve issues that can be broken down…
Q: What is the function of the HTML5 canvas element?
A: HTML5: HTML5 is a markup language for organizing and delivering web information.It is the fifth and…
Q: What is the output of the following program
A: The output is as follows: 0 1 2 3 1 2 3 4 2 3 4 5 3 4 5 6 4 5 6 7
Q: What is the full form of CPU?
A:
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Modify the Item class to maintain a priority value. This value must also be set in the constructor.
private int num;
public Item(int num)
{
this.num = num;
}
public int GetNum()
{
return num;
}
Step by step
Solved in 3 steps with 1 images
- public class ItemToPurchase { private String itemName; private int itemPrice; private int itemQuantity; // Default constructor public ItemToPurchase() { itemName = "none"; itemPrice = 0; itemQuantity = 0; } // Mutator for itemName public void setName(String itemName) { this.itemName = itemName; } // Accessor for itemName public String getName() { return itemName; } // Mutator for itemPrice public void setPrice(int itemPrice) { this.itemPrice = itemPrice; } // Accessor for itemPrice public int getPrice() { return itemPrice; } // Mutator for itemQuantity public void setQuantity(int itemQuantity) { this.itemQuantity = itemQuantity; } // Accessor for itemQuantity public int getQuantity() { return itemQuantity; }} import java.util.Scanner; public class ShoppingCartPrinter { public static void main(String[] args) { Scanner scnr = new…Assignment:The BankAccount class models an account of a customer. A BankAccount has the followinginstance variables: A unique account id sequentially assigned when the Bank Account is created. A balance which represents the amount of money in the account A date created which is the date on which the account is created.The following methods are defined in the BankAccount class: Withdraw – subtract money from the balance Deposit – add money to the balance Inquiry on:o Balanceo Account ido Date createdclass Point { private: int x, y ; public: : x(u), y(v) {} Point (int u, int v) int getX) { return x; } int getY () { return y; } void doubleVal() { *= 2: y *= 2; } }; int main () { const Point myPoint (5, 3) myPoint.doubleVal() ; cout << myPoint.getX() << " " return 0; << myPoint.getY() << "\n"; }
- C# languageCreate a class for “Plane” having functionalities (methods) startengine(), fly() and land(). When ever engine starts it should reset the attribute TTK (Total travel kilometer) to zero and attribute Fuel to 100. On fly() it should add 10 kilometers if the Fuel attribute is greater than zero and decrement Fuel by 20.On land() it should print total distance covered. Write the code providing all necessary details. And then show working object of Plane in main().public class Application { public static void main(String[] args) { Employee empl = new Employee(); empl.firstName = "Ali"; empl.lastName = "Omar"; empl.salary = 20000; Employee emp2 = new Employee(); emp2.firstName = "Mohamed"; emp2.lastName = "Nour"; emp2.salary = 30000; System.out.println("- System.out.printin("- empl.employeeSalary(); System.out.println("- empl.checkEmployeeSalary(emp1.salary, emp2.salary); System.out.printin("- System.out.println("- printEmployee(emp2); System.out.printin("- Employee employeeArr[] = new Employee[2]: employeeArr[0] = empl; employeeArr[1] = emp2; Application a = new Åpplication(); a.printArrayofEmployee(employeeArr); Non static (instance) start to call Static function to print ---------"); "); - Non Static function to print - --"); Non static (instance) start to call same class Static function to print --------); -"); Non Static function to print ----); System.out.println("- System.out.printin("- System.out.printin("Salary : " + Employee.salary);…Remaining Time: 35 minutes, 18 seconds, ¥ Question Completion Status: A class named Account is defined as the following. class Account } private: int id; double balance; public: //A constructor without parameter that creates a default account with id 0, balance 0 Account): /A constructor with the parameter that setting the id and balance Account(int, double), int getId); / return the ID double getBalance() //return the balance void withdraw(double amount) // the amount will be withdrawn void setlID(int), //set the ID void setBalance (double) //set the balance }: Assume that we will create a separate file of implementation of the function definition for the questions a) -b) a) Write a construction function definition with two parameters (ID and balance). b) Write a function definition of the function declaration (void withdraw(double amount):). c) Creates an Account object with an ID (1122) and balance ($20000). Then, write source codes to withdraw $2 MacBoo
- Circle ClassWrite a Circle class that has the following fields:• radius: a double• PI: a final double initialized with the value 3.14159The class should have the following methods:• Constructor. Accepts the radius of the circle as an argument.• Constructor. A no-arg constructor that sets the radius field to 0.0.• setRadius. A mutator method for the radius field.• getRadius. An accessor method for the radius field.• area. Returns the area of the circle, which is calculated asarea = PI * radius * radius• diameter. Returns the diameter of the circle, which is calculated asdiameter = radius * 2• circumference. Returns the circumference of the circle, which is calculated ascircumference = 2 * PI * radiusWrite a program that demonstrates the Circle class by asking the user for the circle’s radius, creating a Circle object, and then reporting the circle’s area, diameter, and circumference.class Player { protected: string name; double weight; double height; public: Player(string n, double w, double h) { name = n; weight = w; height = h; } string getName() const { return name; } virtual void printStats() const = 0; }; class BasketballPlayer : public Player { private: int fieldgoals; int attempts; public: BasketballPlayer(string n, double w, double h, int fg, int a) : Player(n, w, h) { fieldgoals = fg; attempts = a; } void printStats() const { cout << name << endl; cout << "Weight: " << weight; cout << " Height: " << height << endl; cout << "FG: " << fieldgoals; cout << " attempts: " << attempts; cout << " Pct: " << (double) fieldgoals / attempts << endl; } }; a. What does = 0 after function printStats() do? b. Would the following line in main() compile: Player p; -- why or why not? c. Could…Public Class SavingsAccount { float interest; float FixedDeposit; SeniorAccount(float interest, float FixedDeposit) { this. interest = interest; this.fixedDeposit= FixedDeposit; } float calculateInterest(); { System.out.println(“Calculating Savings Account Interest”); return(FixedDeposit*interest/100); } } Public Class SeniorAccount extends SavingAccount { float seniorInterest; SeniorAccount(float interest, float FixedDeposit) { this.seniorInterest=interest; super(interest, FixedDeposit) } float calculateInterest() { System.out.println(“Calculating Savings Account Interest”); return(FixedDeposit*seniorinterest/10); } } Public static void main(String args[]) { SavingsAccount saving = new SavingsAccount(6,100000); System.out.println(saving.calculateinterest()); SeniorAccount senior=new seniorAccount(10,100000); System.out.println(Senior.calculateInterest()); } Correct the syntax and logical error
- Public Class SavingsAccount { float interest; float FixedDeposit; SeniorAccount(float interest, float FixedDeposit) { this. interest = interest; this.fixedDeposit= FixedDeposit; } float calculateInterest(); { System.out.println(“Calculating Savings Account Interest”); return(FixedDeposit*interest/100); } } Public Class SeniorAccount extends SavingAccount { float seniorInterest; SeniorAccount(float interest, float FixedDeposit) { this.seniorInterest=interest; super(interest, FixedDeposit) } float calculateInterest() { System.out.println(“Calculating Savings Account Interest”); return(FixedDeposit*seniorinterest/10); } } Public static void main(String args[]) { SavingsAccount saving = new SavingsAccount(6,100000); System.out.println(saving.calculateinterest()); SeniorAccount senior=new seniorAccount(10,100000); System.out.println(Senior.calculateInterest()); } Rubric: Correct the syntax and logical errors Proper working codeObject-oriented programmingProgram the employee class as indicated in the diagramTo calculate the salary, just multiply the number of hours by the payment per hour.The capture method asks the user for the data for the three attributes, asks for the hours worked and the payment per hour and with these data calculates the salary.The show method displays all of the employee's data.Do not forget the getter and setter methods only for attributes of type privateYour company has 7 employees and you would like1. Capture the data of each employee2. Show the data of each employee3. Show the data of a particular employee4. Calculate and display the average salary5. Calculate and display the name of the employee with the highest salary6. Calculate and display the name of the employee with the lowest salary7. Calculate and show the total payment you will make for all your employeesJAVA Language Caesar Shift Question: Modify the Caesar class so that it will allow various sized shifts to be used, instead of just a shift of size 3. (Hint: Use an instance variable in the Caesar class to represent the shift, add a constructor to set it, and change the encode method to use it.) import java.util.*; public class TestCipher { public static void main(String[] args) { int shift = 7; Caesar caesar = new Caesar(); String text = "hello world"; String encryptTxt = caesar.encrypt(text); System.out.println(text + " encrypted with shift " + shift + " is " + encryptTxt); } } abstract class Cipher { public String encrypt(String s) { StringBuffer result = new StringBuffer(""); // Use a StringBuffer StringTokenizer words = new StringTokenizer(s); // Break s into its words while (words.hasMoreTokens()) { // For each word in s…