All unsafe states are : a. deadlocks b. not deadlocks c. fatal d. none of the mentioned
Q: Open up Eclipse and create a new class called ArrayListPractice.java Next, copy and paste the below…
A: Required Java code with Arraylist is given below along with screenshot of compiled output
Q: 2. Write a program that maintains a database containing data, such as name and birthday, about your…
A: Solution :: Let's see first what is C++ and its uses ? Answer :: C++ is a powerful…
Q: Using pseudo code (java), provide an algorithm for the folowing use cases; -Manage bank account…
A: Note: As you have asked a multipart question (use-cases), as per our policy, we will solve the first…
Q: True or False. The below code correctly defines an interface: public interface MyFace { int numEyes…
A: Interface has an abstract method abstract method means only method declaration is there no method…
Q: Write the code segments in main( ) and in methodA( ) for the following scenario: main( ) passes…
A: throw is the keywords used to explicitly throw an Exception by user and as of now we are not worried…
Q: A job ad for Gaggle Inc. says: It is necessary to major in either math, computer science, or…
A: We define well-formed-formula (wffs) inductively: Every primitive (atomic) proposition is a wff If…
Q: (Java) Create a class named Customer that will determine the monthly repayment amount due by a…
A: Program description: The driver java program Customer_Finance prompts the user to enter the customer…
Q: Why did Test Case 12 and 13 fail when I ran the code?
A: In this question we have to fix the program for a basic chat bot using Java program.Let's code and…
Q: (The Triangle class) Design a class named Triangle that extends GeomericObject. The class contains:…
A: According to the asked question, the solution is given below with a proper explanation.
Q: (Intro to Java) Avoid using breaks in loops or statments. Ice Cream Truck In this program, you…
A: import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner…
Q: You must create (in C++) two Crosswalk Signal objects from the class shown below to prove that your…
A: C++ is a general-purpose programming language as an extension to the C programming language. It is a…
Q: (T/F) Mutable classes can easily be made immutable by taking out the setter methods. Yes o No
A: Here have to determine the mutable class to made immutable by taking out setter methods.
Q: Type two statements that use rand() to print 2 random integers between (and including) 100 and 149.…
A: Algorithm: START Take a seed value from the user. Set the seed with the input seed value. Set an…
Q: Create a class named Caesar Cipher that has the following. • Write a public static method named…
A: To implement Caesar cipher code in which each letter in the text is "shifted" to a certain number of…
Q: 7. An anonymous union declaration actually creates the member variables in memory. a TRUE b. FALSE…
A: Note: According to bartleby policy I can answer the first 3 questions for remeaning questions please…
Q: (The Fan class) Design a class named Fan to represent a fan. The class contains: 1 Three constants…
A: Program Approach – Declare the class Fan. Declare the variables as per the requirement. Define a…
Q: Please read carefully and follow the instruction: Create the following classes. Use appropriate…
A: public class Item { private String title; private String description; private double…
Q: (In JAVA)Add the following class method: A method that asks for the username and password of the…
A: import java.util.*; public class methods { public static void logininfo() { Scanner sc=new…
Q: (Date Class) Create a class called Date that includes three pieces of information as…
A: Note: You didn't mention any programming languages so i use Java Program: //Date.java public class…
Q: (The Fan class) Design a class named Fan to represent a fan. The class contains: - Three constants…
A:
Q: Movie x = new Movie("ET...","Et was from Jupiter", 6.0, 2); CD cd = new CD("Best","Xcompany",15.0,…
A: JAVA public class Item { private String title; private String description; private…
Q: Machine A executes a program with an average CPI of 2.0. Machine B executes the same program with…
A: The performance of a machine is directly proportional to the product of number of instructions in…
Q: Introduction ID Forgery has been a prevalent issue in the city of Einstakt, especially in bars. You…
A: Sharing user login credentials Posting any of the information pertaining to Client on social media…
Q: see image) Consider the following code. Replace the tags _??1_ and _??2_, respectively, by filling…
A: Please upvote. I am providing you the correct answer below. Please please please.
Q: Create an accessor method to return the years
A: Create an accessor method to return the years
Q: This is a debugging question I am struggle with - The files provided in the code editor to the…
A: Note : I have explained all the fixes made, in comments, right above the statements where the fix…
Q: (The Rectangle class) Following the example of the Circle class in Section 8.2,design a class named…
A: Note: The given program is compiled and executed in "NetbeansIDE"
Q: Draw the UML diagram for the class and then implement the class. Write a test program that creates…
A:
Q: Algorithm 5.7 The Backtracking Algorithm for the 0-1 Knapsack Problem Problem: Let n items be given,…
A: The 0-1 Knapsack problem aims to maximize the total profit by selecting items with given weights and…
Q: (Java) DO PART 2! PART 2 IS BASED OFF PART 1!!! PART 1: Open up a new Java project called…
A: Solution: Part-1 Java Code: PersonTest.java class Person{ public String name;…
85. | All unsafe states are : |
a. | deadlocks |
b. | not deadlocks |
c. | fatal |
d. | none of the mentioned |
Step by step
Solved in 2 steps
- (The Fan class) Design a class named Fan to represent a fan. The class contains:■ Three constants named SLOW, MEDIUM, and FAST with the values 1, 2, and 3 todenote the fan speed. The Fan classVideoNoteM08_LIAN6521_09_SE_C08.qxd 2/2/12 10:21 PM Page 331332 Chapter 8 Objects and Classes■ A private int data field named speed that specifies the speed of the fan (thedefault is SLOW).■ A private boolean data field named on that specifies whether the fan is on (thedefault is false).■ A private double data field named radius that specifies the radius of the fan(the default is 5).■ A string data field named color that specifies the color of the fan (the defaultis blue).■ The accessor and mutator methods for all four data fields.■ A no-arg constructor that creates a default fan.■ A method named toString() that returns a string description for the fan. Ifthe fan is on, the method returns the fan speed, color, and radius in one combinedstring. If the fan is not on, the method returns the fan color…(IllegalArgumentException)Programming defined the Triangle class with three sides. In the a triangle the sum of any two sides is greater then than the other side. Create IllegaTriangleException class, and modify the constructor of Triangle classto throw an IllegaTriangleException object if a triangle is created with sides that violate the rule, as follows: /** Construct a tringle the specified sides*/ public Triangle(double side1, double side2, double side3) throws IllegaTriangleException{ //Implement(in java) Add the following class methods to the program below A method that asks for the username and password of the user. Note: Because we do not have any database, just assume all username/password combinations are valid, so set the isAuthenticated variable to true and print a login successful message inside this method with the value of isAuthenticated variable. A method that prints Top 5 Trending items in ascending order. (Use Arrays.sort() library method to quickly sort arrays). A method that prints logged in username, remaining balance and subscriber since information. A method (like updateContinueWatching(String strValue) which takes a String parameter and updates the Continue Watching array for the user. So in NetflixDemo class, take a movie or TV show name as input from the user and pass it to this updateContinueWatching(value) method. Print the final Continue Watching array. Note: New value should take first position in the Continue Watching array (index 0).…
- (Rational Class) 1. Create a class called Rational (separate the files as shown in the chapter) for performing arithmetic with fractions. Write a program to test your class. Use integer variables to represent the private data of the class-the numerator and the denominator. Provide a constructor that enables an object of this class to be initialized when it's declared. The constructor should contain default values in case no initializers are provided and should store the fraction in reduced form. For example, the fraction 2/4 would be stored in the object as 1 in the numerator and 2 in the denominator. Provide public member functions that perform each of the following tasks: Make an overloaded operator of the + symbol for the add method - Adds two Rational numbers. The result should be stored in reduced form. Make an overloaded operator of the - symbol for the subtract method - Subtracts two Rational numbers. Store the result in reduced form. Make an overloaded operator of the *…This is a debugging question I am struggling on - The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly. Code - public class DebugCustomer { protected int idNumber; protected String name; protected double creditLimit; public DebugCustomer(int id, name, double creditLimit) { idNumber = id; name = name; creditLimit = credit; } public void display() { System.out.println("Customer # + idNumber + Name: " + name, "\nCredit limit $" + creditLimit); } } ----- public class DebugCustomerMakingPurchase extends DebugCustomer { private double amountOfPurchase; private boolean overLimit; public DebugCustomerMakingPurchase(int id, String name, double credit, double purchAmount) { amountOfPurchase = purchAmount;…Using import sys : Create a python program called classname.py. The program should define a classcalled person that has one method called hello, and one attribute called name,which represents the name of the person.
- (The Account class) Design a class named Account that contains: 1 A private int data field named id for the account. I A private float data field named balance for the account. A private float data field named annualInterestRate that stores the current interest rate. I A constructor that creates an account with the specified id (default 0), initial balance (default 100), and annual interest rate (default 0). 1 The accessor and mutator methods for id, balance, and annualInterestRate. IA method named getMonthlyInterestRate() that returns the monthly interest rate. 1A method named getMonthlyInterest() that returns the monthly interest. IA method named withdraw that withdraws a specified amount from the account. 1 A method named deposit that deposits a specified amount to the account. Draw the UML diagram for the class, and then implement the class. (Hint: The method getMonthlyInterest() is to return the monthly interest amount, not the interest rate. Use this formula to calculate the…Instructions-Java Assignment is to define a class named Address. The Address class will have three private instance variables: an int named street_number a String named street_name and a String named state. Write three constructors for the Address class: an empty constructor (no input parameters) that initializes the three instance variables with default values of your choice, a constructor that takes the street values as input but defaults the state to "Arizona", and a constructor that takes all three pieces of information as input Next create a driver class named Main.java. Put public static void main here and test out your class by creating three instances of Address, one using each of the constructors. You can choose the particular address values that are used. I recommend you make them up and do not use actual addresses. Run your code to make sure it works. Next add the following public methods to the Address class and test them from main as you go: Write getters and…Can you write this in C++?? Assignment 8 B: Hit Boxes (Part 2). Back in Assignment 2 (so long ago!) we created a simple program to determine what a hit box would be. Now we’re going to use that information to determine if two characters would collide based on those hit boxes.You will create a Player class that takes in the following private attributes (as integers) when creates Width Height X position Y position In addition to Getter methods for all four attributes, the Player class should also have the following methods: MoveHorizontal(int x_delta)◦ Takes in either a negative integer (for moving left) or a positive integer (for moving right). It should update the X position of the Player object MoveVertical(int y_delta)◦ Takes in either a negative integer (for moving down) or a positive integer (for moving up). It should update the Y position of the Player object DidTheyCollide(Player otherPlayer)◦ Takes in another player object, and returns true if they collided with each…
- 1 DO NOT COPY FROM OTHER WEBSITES Correct and detailed answer will be Upvoted else downvoted. Thank you!(Car Class) Create a class called Car that includes three instance variables-a model (type String), a year (type String), and a price (double). Provide a constructor that initializes the three instance variables. Provide a set and a get method for each instance variable. If the price is not positive, do not set its value. Write a test application named CarApplication that demonstrates class Car's ca- pabilities. Create two Car objects and display each object's price. Then apply a 5% discount on the price of the first car and a 7% discount on the price of the second. Display each Car's price again. 3.13in c++ code