Referring to the previous DecimalFormatting class, there were three lines of code. static DecimalFormat df = new DecimalFormat("#,##0.00; (###0.00)"); static DecimalFormat df1 = new DecimalFormat("##0.0%"); static DecimalFormat df2 = new DecimalFormat("$ #,###0.00;$ (# ###30.00)"); Learning item 1: these are considered global variables (df, df1 and df2) because they are ahead of main, outside of a method and at the class level. Learning item 2: they are all declared "static" because they are referred to and used by main(...), which is a static method. Your question: df, df1 and df2 are considered to be direct object instances of which class? java Ojava.text DecimalFormat NumberFormat
Q: Write a C++ program to create a file with variable length records.The records in the file are of two...
A: Here I have code for you in C++ were you can differentiate given code into employee base and student...
Q: What does the term "memory leak" signify in the context of dynamic memory allocation?
A: Dynamic Memory: In dynamic memory allocation memory is allocated at the run time and this memory is...
Q: What step of the compiler is it that may be causing the syntax error?
A: Your answer is given below in detail.
Q: What is it about virtual memory that prevents it from being employed more often in embedded systems?
A: Introduction: Virtual memory, or virtual storage, is a memory management strategy in computing that ...
Q: Write a class called MonetaryCoin that is derived from the Coin class presented in Chapter 5. Store ...
A: Coin class we could define the following data: face, an integer that represents the current face HE...
Q: Create a MATLAB program to read input the length of the side of a cube(in cm) and then it displays t...
A: Requirement: Create a MATLAB program to read input the length of the side of a cube(in cm) and then...
Q: Preventing unethical and illegal behaviour in the field of computer science
A: Introduction: 'Unethical' refers to something that is morally incorrect, whereas 'illegal' refers to...
Q: What are the benefits of utilizing a compiled language as opposed to an interpreted language, and wh...
A: Introduction: Compilation into native machine code produces programmes that are often quicker than i...
Q: Wil you plz show me an examle of how to connect a mvc5 with an sql server
A: Will you plz show me an example of how to connect a mvc5 with an sql server Answer: This will demon...
Q: Are there any consequences if a processor makes a cache-unfulfilled request while a block is being s...
A: Introduction: The write buffer and the cache are completely independent of one another. The cache w...
Q: The Big-O of the following equation is: 3log n + 5n3 - 2n 3log n 5n3 O Option 1 Option 2 2n Option 3...
A: The correct option is option 4. n
Q: Write program to copy a block of 8 bytes of data to RAM locations starting at 50H from RA ocations 3...
A: Below assembly program to copy a block of 8 bytes of data to RAM locations starting at 50H form RAM ...
Q: What is the definition of a window?
A: INTRODUCTION: Here we need to define the window in computer science.
Q: et A = ({40, 41, 42}, {a, b}, 8, q0, {41}) be the NFA with transition table: a b 90 {40, 41, 42} {q1...
A: I have answered all the 3 parts and have uploaded image for the solution.
Q: What are the four responsibilities that every router has?
A: Introduction: Router: It is a network device that forwards data packets. It forwards data packets f...
Q: 1. Write a program in C++ to print your full name and the sum of two numbers and determine if the su...
A: ALGORITHM:- 1. Take input for the name from user. 2. Take input for the numbers from the user. 3. Pr...
Q: Explain the steps involved in installing local software, portable software, and Web-based applicatio...
A: Introduction: Software: It's a collection of computer instructions, data, or applications used to ru...
Q: We can see that the characteristics for network layers may be broadly divided into functionality for...
A: In a network, a data plane, also known as a forwarding plane, is employed. The fundamental purpose o...
Q: In your own words, explain the control plane and data plane concepts in Software Defined Networks. E...
A: control-plane: The Control plane alludes to the capacities and cycles that figure out which way to ...
Q: What is the definition of a web application?
A: Introduction: A computer is an electrical device that may be used to perform a variety of functions....
Q: What is the significance of watchdog timers in many embedded systems?
A: Watchdog Timers is widely used in the computers for automatic correction of the temporary hardware f...
Q: One feature of a capacity-based defense strategy is the ability of one process to send a replica of ...
A: Introduction: Transfer of right of access The ticket associated with the specified security scheme i...
Q: a) Write a queue code with Java comparable class which will store the records of 3 students i) Stude...
A: As per the requirement java program is developed. The two classes Student.java and StudentQueue.java...
Q: Discuss on Elsevier
A: Elsevier - the world's largest academic publishing company - is often synonymous with controversy. W...
Q: Convert the decimal signed number -7 into 8-bit signed binary number. The signed binary number is 11...
A: Answer:
Q: "Machine learning is an empirical science," says the author. What is the meaning of this statement?
A: Introduction: Machine learning is the study of computer algorithms that learn on their own. Machine ...
Q: List and describe the main tasks required in developing a software system.
A: Intro In the software development service, different software development models are used depending ...
Q: QUESTION THREE (3) Given the grammar G = ({S}, {a, b}, S, P) with production S → aSa, S → bSb, S → ε...
A: Given production rules: S → aSa S → bSb S → ε
Q: 1. In the code editor, you are provided with a main() function that asks the user for 3 integers. 2....
A: Pointer variables are also known as address data types because they are used to store the address of...
Q: Heating and cooling degree days with user input Modify the pervious program to get its input from a ...
A: Hey there, I am writing the required solution of the above stated question.Please do find the soluti...
Q: It is unknown what factors had a part in the evolution of computer security into the present era of ...
A: Intro The elements listed below have aided in the growth of computer security into current informat...
Q: Make a list of all the databases that have information on you and your previous activity and keep it...
A: Introduction Personal information includes a person's name, signature, home address, email address, ...
Q: ties: The vector is three-dimensional, with default value equal to . The + operator can be used be...
A: Hey there, I am writing the required solution of the above stated question.Please do find the soluti...
Q: What is the purpose of using MATLAB to tackle problems in Computational Geometry?
A: Introduction: The major purpose of combinatoric computational geometry research is to provide effici...
Q: The question is, whether kind of program-level parallelism (data or control) is best suited to SIMD....
A: Introduction: When you decentralize a single program and run it on multiple processors, you implemen...
Q: In this section, you will find four distinct machine learning algorithms that may be utilized for su...
A: Introduction: Programming languages, flowcharts and drakon-charts are examples of notation used to r...
Q: What sorts of functional requirements-related issues can be anticipated if system end-user stakehold...
A: Introduction: Processes that aren't documentedStakeholder participation is an excellent technique to...
Q: Should
A: I have answered below:
Q: What exactly does the term "reduced" imply in the context of a computer with a restricted instructio...
A: The word "reduced" was applied to RISC computers since their instruction set was smaller than that o...
Q: Elitism in Genetic Algorithms is considered to be a wonderful notion, but it is not without its draw...
A: Introduction: The Genetic Algorithm (GA) is a search-based optimization technique based on genetics ...
Q: Create a MATLAB program to read input the length of the side of a cube(in cm) and then it displays t...
A: Step-1: Start Step-2: Declare a variable x and take input from user Step-3: Calculate volume by x ^ ...
Q: Evaluate the following MATLAB expressions by hand and use MATLAB to check the answers 2 / 2 * 3 6 - ...
A: Hey there, I am writing the required solution of the above stated question.Please do find the soluti...
Q: Computer science What are the advantages of utilising exception handling?
A: 1.Provision to Complete Program Execution:One of the significant reasons for special case taking car...
Q: What is the first general-purpose computer which consumes a huge room as its storage? a) EDVAC b) EN...
A: Your answer is given below with explanation.
Q: A program is required to read from the screen the lenghth and width of a rectangular house block, an...
A: The Answer for the given question is start from step-2.
Q: Are there any specific risks that a company considering outsourcing should be aware of during the pa...
A: Introduction: Contracting out corporate capabilities and cycles to external providers is a common pr...
Q: Systems employed for motion control are called DRIVES, and may employ any of prime movers such as di...
A: Solution :: Given that the process size necessitates 9MB of memory, it necessitated (2^24) bits. ...
Q: are thinking of creating a new cryptocurrency, and you want the block chäin tổ have the wing paramet...
A: Hey there, I am writing the required solution of the questin mentioned above. Please do find the sol...
Q: Assume a computer has two network interface cards, NIC1, a Wifi USB, and NIC2, an on-board Ethernet....
A: The network interface card (NIC) enables computers to interact across a computer network via wired o...
Q: the following schedules S: R1(X); R2(Z); R3(Y), W1(X); R2(Y); R2(Z); W2(X); W1(Y) Draw the precedenc...
A: We are given a schedule and we are going to draw its precedence graph and then we will check if the ...
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Please, I want to modify the code so that the user can add the employee's name, number and specialization, and use for loob He must add more than one employee. When he finishes adding the employee’s data, he asks the user: Do you want 1-Print the data 2-Add a new employee 3-Exit class Doctor:"""Represents a Doctor""" #initializer with specialization default to "general"def __init__(self, Id, name, specialization="general"):#attributesself.Id = Idself.name = nameself.specialization = specialization.lower() #initializing salary to 25000, basic salaryself.salary = 25000 #incrementing salary based on specialization#if specialization is pediatric, increasing salary by 10%if specialization == "pediatric":self.salary += self.salary*10/100 #if specialization is dental, increasing salary by 15%elif specialization == "dental":self.salary += self.salary*15/100 #str() functiondef __str__(self):return (f"Id: {self.Id} \n"f"Name: {self.name} \n"f"Specialization: {self.specialization} \n"f"Salary:…please help debuging... // Fix the bugs so that the report of 5 students grades// is correct. There should be no memory leaks.#include <stdio.h>#include <string.h>#include <stdlib.h>#include <assert.h> typedef struct student{ int grade; char* nameID;}student_t; void CreateStudent(student_t* s, int grade, char* nameID){ s->grade = grade; s->nameID = strdup(nameID); } //float ComputeAverageGrade(student_t* class, int sizeOfClass){ assert(sizeOfClass > 0 && "Must have at least 1 student"); float total=0.0f; for(int i=0; i <= 5; i++){ total+= class[i].grade; } return total / sizeOfClass;} int main(){ // Create our classroom of 5 students student_t* class = (student_t*)malloc(sizeof(student_t)*5); for(int i=0; i <5 ; i++){ // Assume all nameID's are "temporary" CreateStudent(&class[i],90,"temporary"); } // Storage for students grades float averageGrade =…Hello, there is currently an error in my code where I am told the following: Traceback (most recent call last): File "C:/Users/thepe/PycharmProjects/CPE101Labs/Dunder Mifflin/Employee Managment/employee.py", line 1, in <module> class employee: File "C:/Users/thepe/PycharmProjects/CPE101Labs/Dunder Mifflin/Employee Managment/employee.py", line 67, in employee employeeList.append(employeeList("Michael", 45, "Manager"))TypeError: 'list' object is not callable Here's my code: class employee:def __init__(self, name, age, position):self.name = nameself.age = ageself.position = positiondef display_employees(listOfEmployees):print()print("Employees in Dunder Mifflin are:")print()for item in listOfEmployees:print(item.name + ",", str(item.age) + ",", item.position)def allocate_department(listOfEmployees):allocatedList = []managementList = []salesList = []accountantList =[]for employee in listOfEmployees:if employee.positon == "Manager" or "Manager" in…
- For Chapter 6, section 6 of the book the image shows, I'm trying to solve a true or false question. I was wondering if you can help solve them and provide an explanation. Thank you Throws an exception if an element is added when it is "full". Supports addition of elements at the front of the list, the end of the list, and anywhere in between. Can hold objects of any Java class. Has only O(1) operations, including its constructor. Provides more than one Iterator.Language: Java Rewrite the ADA source code in Java.Within the Java version of the code, change the second half of the first loop so that all assignments to the counting array 'Freq()' are updated in the EXCEPTION portion of the code. There should be no valid updates to 'Freq()' anywhere else in the loop.ADA source code:with Ada.Text_IO , Ada.Integer_Text_IO ;use Ada.Text_IO, Ada.Integer_Text_IO;procedure Grade_Distribution isFreq: array (1..10) of Integer := (others => 0);New_Grade : Natural;Index,Limit_1,Limit_2 : Integer;beginGrade_Loop:loopbeginGet(New_Grade);exceptionwhen Constraint_Error =>exit Grade_Loop;end;Index := New_Grade/10 + 1;beginFreq(Index) := Freq(Index) +1 ;exceptionwhen Constraint_Error =>if New_Grade = 100 thenFreq(10) := Freq(10) + 1;elsePut("Error -- new grade: ");Put(New_Grade);Put(" is out of range");New_Line;end if;end;end loop Grade_Loop;Put("Limits Frequency");New_Line; New_Line;for Index in 0..8 loopLimit_1 := 10 * Index;Limit_2 := Limit_1 + 9;if…I already have the code for the assignment below, but there are some errors in the code. Please help me fix the code. The assignment: Continue Exercise •• P13.1, checking the words against the /usr/share/dict/words on your computer, or the words.txt file in the companion code for this book. For a given number, only return actual words. The code of resource class: import java.io.File;import java.io.FileNotFoundException;import java.util.ArrayList;import java.util.Scanner; public class U10P02R{ static ArrayList<String> words = new ArrayList<String>(); U10P02R(){ try { File myObj = new File("words.txt"); Scanner myReader = new Scanner(myObj); while (myReader.hasNextLine()) { String data = myReader.nextLine(); words.add(data); } myReader.close(); } catch (FileNotFoundException e) { System.out.println("An error occurred."); e.printStackTrace(); } } // This method to returns a character array…
- Modify songVerse to play "The Name Game" (see OxfordDictionaries.com), by replacing "(Name)" with userName but without the first letter.Ex: If userName = "Kaitlin" and songVerse = "Banana-fana fo-f(Name)!", the program prints:Banana-fana fo-faitlin! Ex: If userName = "Kaitlin" and songVerse = "Fee fi mo-m(Name)", the program prints:Fee fi mo-maitlin Note: You may assume songVerse will always contain the substring "(Name)". *Please write this code in C++*USE THE PROGRAM CODE BELOW TO CODE 1. COMMAND LINE ARGS CODE IN JAVA 1. Command Line Args Modify problem # 1 from Lab 8 to accept the values for the key as command line arguments. Your program may assume the arguments given at the command line are integers. If there are no arguments, print a message. If there is at least one argument, compute and print the average of the arguments. Note that you will need to use the parseInt method of the Integer class to extract integer values from the strings that are passed in. If any non-integer values are passed in, your program will produce an error, which is unavoidable at this point. Test your program in NetBeans using the data for problem # 1 Lab 8 as command line arguments. import java.util.Scanner;import java.text.NumberFormat; public class Quizzes{ //---------------------------------------------- // Read in the number of questions followed by // the key, then read in each student's answers // and calculate the number…PLEASE WRITE A PYTEST BASED OFF THE FOLLOWING CODE. PLEASE DO NOT COPY ANYTHING THATS ON CHEGG class PhoneCall(AbstractPhoneCall): time_format = "%H:%M" # 24-hour format def __init__(self, caller, callee, start, end): self.caller = caller self.callee = callee self.start_str = start self.end_str = end self.parse_times(start, end) def parse_times(self, given_start, given_end): start = datetime.strptime(given_start, self.time_format) end = datetime.strptime(given_end, self.time_format) self.start = start.time() self.end = end.time() def get_caller(self) -> str: return self.caller def get_callee(self) -> str: return self.callee def get_starttime(self) -> time: return self.start def get_starttime_string(self) -> str: return self.start_str def get_endtime(self) -> time: return self.end def get_endtime_string(self) -> str: return self.end_str
- Question: Change this code in java just with changing abstraction and exception handling #include <stdio.h>#include <string.h>#include <stdlib.h> typedef struct Guests{char name[50];int status;int nights;float room_cost;float srv;float cost;} G; void options(G guest[]){int option;printf("\n\nMenu\n-----------\n");printf("1. Check in\n");printf("2. Services\n");printf("3. Invoice\n");;printf("4. Check out\n");printf("5. Exit\n");printf("\nPlease Choose a Number According to the Option: ");scanf("%d", &option);switch(option){case 1:printf("\nCheck in\n-----------\n");check_in(guest);break; case 3:printf("\nInvoice\n-----------\n");invoice(guest);break; case 2:printf("\nRequest\n-----------\n");request(guest);break; case 4:printf("\nCheck out\n-----------\n");check_out(guest);break; case 5:exit(0);break;}} void check_in(G guest[]){int i, choice, nights;printf("Rooms:\n\n");for(i=0;i<4;i++){printf("Room No.%d\n", i+1);printf("Room Cost: %.2f/night\n",…How do I fix the error Java? Error ---------- Movie.toString() returns: Movie: [ Minutes 142 | Movie Name:The Shawshank Redemption | not kid friendly | Number of Cast Members: 3 | Cast Members: ] instead of: Movie: [ Minutes 142 | Movie Name: The Shawshank Redemption | not kid friendly | Number of Cast Members: 3 | Cast Members: Tim Robins, Morgan Freeman, Bob Guton ] without bringing this error Error ---------- Exception occurred while calling Movie.toString() Code: import java.util.*; import java.util.Arrays; public class Movie { private String movieName; private int numMinutes; private boolean isKidFriendly; private int numCastMembers; private String[] castMembers; // default constructor public Movie() { this.movieName = "Flick"; this.numMinutes = 0; this.isKidFriendly = false; this.numCastMembers = 0; this.castMembers = new String[10]; } // overloaded parameterized constructor public Movie(String movieName, int numMinutes, boolean isKidFriendly, String[] castMembers)…Please do in Java In many computer systems and networks,different users are granted different levels of access to different resources. In this case, you are given a int[] rights, indicating the privilege level of each user to use some system resource. You are also given a int minPermission, which is the minimum permission a user must have to use this resource. You are to return a String indicating which users can and cannot access this resource. Each character in the return value corresponds to the element of users with the same index. 'A' indicates the user is allowed access, while 'D' indicates the user is denied access. Constraints users will contain between 0 and 50 elements, inclusive. Each element of users will be between 0 and 100, inclusive. minPermission will be between 0 and 100, inclusive. Examples a) {0,1,2,3,4,5} 2 Returns: "DDAAAA" Here, the first two users don't have sufficient privileges, but the remainder do. b) {5,3,2,10,0} 20 Returns: "DDDDD"…