Task 9 class Test: def init (self): self.sum = 0 self.y = 0 def methodA(self): x=0 y =0 y = y + 7 x = y + 11 self.sum = x + y print(x y, self.sum) def methodB (self): x = 0 self.y = self.y + 11 x = x + 33 + self.y self.sum = self.sum + x + self.y print(x , self.y, self.sum) t1 = Test() t1.methodA ( ) t1.methodA () t1.methodB () t1.methodB () y sum
Q: List and explain the primary tasks involved in the creation of a software system.
A: In the software development service, different software development models are used depending on the...
Q: The following two technologies are the most frequently used in wireless networks: ad hoc networks an...
A: Two technologies are the most frequently used in wireless networks: ad hoc networks mesh networks
Q: Let R = (J,K, L, M, N, P) and F = {J → KL, L → J, MNP → K, KP – M, LJ → N}, give a canonical cover F...
A: As per guideline, I can do only first one. Please re-post pending question in next post. I hope you ...
Q: What are the five regions of databases where data security vulnerabilities are present?
A: Introduction: Database security refers to the many steps taken by businesses to secure their databas...
Q: etwork's purpose?
A: Networks Purpose:- It's main purpose is transmitting, exchanging, or sharing data and resources
Q: Answer the following questions for a random graph generated by the Erdos-Renyi random graph model ER...
A: Hey there, I am writing the required solution of the above stated question.Please do find the soluti...
Q: When comparing wireless networks to wired networks, wireless networks have a lesser throughput than ...
A: Ans : True that When comparing wireless networks to wired networks, wireless networks have a lesser ...
Q: ARM7 processors are compared to Intel (i3, i5, i7) processors.
A: The Answer is in step2
Q: What's the difference between pirated and fake software?
A: Introduction: Piracy is defined as the act of downloading or transmitting software unlawfully and wi...
Q: C++ PROGRAMMING EXERCISE Given an array of integers that contains 5 integers. Write a program to fin...
A: Required:- C++ PROGRAMMING EXERCISE Given an array of integers that contains 5 integers. Write a pro...
Q: Assume your database system is unavailable. Demonstrate your knowledge of database recovery strategi...
A: ASSUME YOUR DATABASE SYSTEM IS UNAVAILABLE. Demonstrate your knowledge of database recovery strategi...
Q: "What happens if a process tries to visit a page that hasn't been cached? What are the steps in this...
A: In CPU, if a process wants to access the page then first it checks the cache. The access time of the...
Q: What exactly is the difference between forwarding and routing when it comes to routing operations?
A: Answer :
Q: Python: How do I get the total of bal of top4(which can be specified)) bal = { "bal": [ 3955,...
A: I have provided PYTHON CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOT--------------...
Q: Is there a significant distinction between a hacktivist and a cyberterrorist, in your opinion. Wheth...
A: Hacktivist is the peaceful pursuit of political goals via the use of unlawful or legally ambiguous d...
Q: How can you avoid the four most typical types of database failure?
A: Introduction: According to this definition, a database failure is described as the system's inabilit...
Q: When it comes to the central processing unit, registers serve as small, rapid data storage areas tha...
A: Introduction: Registers are compact, fast, stand-alone data storage locations in the central process...
Q: AIM: Write the program that encrypts and decrypts a given message using the Vigenère Cipher encrypti...
A: Answer is given below .
Q: If a transistor on an integrated circuit chip has a size of 2 microns or less, then the following is...
A: Introduction: Moore's law predicts that electronic gadgets' speed and capacities will double every t...
Q: Which of the following is a valid nextByte() return value? Select one: О а. 128 O b. None of these O...
A: According to the question The nextByte() is the java scanner class method in which is used for scan ...
Q: Talk about the evolution of the internet and the technological foundation upon which it is construct...
A: Introduction: ARPANET adopted TCP/IP on January 1, 1983, and researchers started assembling the "net...
Q: In a computer system, the bus is defined as a set of wires that are used to carry data from one loca...
A: let us see the answer:- INTRODUCTION:- In computer architecture, a bus is a communication system tha...
Q: Develop a code for Gaussian -Filter
A: Here I have provided an python code for Gaussain-Filter. were you can put your known values.....
Q: Make a list of all of the databases that have information about you and your prior activities and ke...
A: Introduction Personal information includes a person's name, signature, home address, email address, ...
Q: asymmet
A: Asymmetric encryption- This encryption technique uses some mathematical expression or permutation fo...
Q: What does the abbreviation GSM stand for? What features does your SIM card have? Computer science
A: We are going to see what GSM stands for and then we will cover all the features of a SIM card.
Q: // Suppose we have the following min-heap: // 2, 3, 4, 16, 7, 11, 9, 31, 18, 21, 12 // After callin...
A: Hey there, I am writing the required solution of the above stated question.Please do find the soluti...
Q: eveloped when SNMPv1 was already available
A: Why SNMPv2 was developed when SNMPv1 was already available?
Q: What is stated in the data manipulation language (DML) for the database management system (DBMS); wh...
A: Introduction: When it comes to database management, a data manipulation language (DML) is a computer...
Q: You will write a program to process the lines in a text file using a linked list ADT and raw pointer...
A: Hey there, I am writing the required solution of the above stated question.Please do find the soluti...
Q: What are the prefix and postfix expressions of (a + b * c) + ((d * e + f) * h)
A: Here, we are going to find out the prefix and postfix expressions of (a + b * c) + ((d * e + f) * h)...
Q: You are a cyber investigator, your task is to write a python program that can read file signatures f...
A: Here we write python program to read file and store signature in list: =============================...
Q: Write a Java program to take a list of strings, print a list where each string has "hi" added at its...
A: Required:- Write a Java program to take a list of strings, print a list where each string has "hi" a...
Q: Honeypots, Honeynets, and Padded Cell Systems What is a Honeypot? Honey nets are designed to? What ...
A: As per the rules of Bartleby I can only solve the first three parts. Kindly post the remaining part ...
Q: If a WiFi receiving device calculates a non-zero Cyclic Redundancy Check on a data frame FCS, what a...
A: CRC(Cyclic Redundancy Check): Its main aim to check the data received at receiver is correct or not....
Q: Which of the following method is not used to tackle IPV4 address space limitations? Choose one a. Fr...
A: I have answered both the parts and have provided necessary explanation with it.
Q: 23. Write a C++ program to input a positive integer n and find the difference in the number of set b...
A: Given: An integer n is taken input from the user. Requirement: Write a C++ program to input the inte...
Q: 14.3. What is the header overhead in the IP protocol?
A: The Internet Protocol (IP) is a collection of rules for routing and addressing data packets so that ...
Q: Write a Java program to take a list of strings, print a list where each string has "hi" added at its...
A: Write a JAVA program to take a list of strings, print a list where each string has "hi" added at its...
Q: 2. Write a JAVA program to input a string and create a new string as shown in the sample output. Inp...
A: Write a JAVA program to input a string and create a new string as shown in the sample output.
Q: Explanation of how views can be used as a data security component, as well as the limitations of its...
A: Introduction: It is the process of verifying data to ensure data quality by ensuring that it has bee...
Q: Write a Java program to take a non-empty string like "Eat" print a string like "EEaEat".
A: Given: To write a java program to take a non empty string like "Eat" print a string like "E|EaEat".
Q: Create a file called toArray.js that reads n strings from the command line, adds them to an array, a...
A: In this question we have to program a JavaScript code where We are supposed to take a user input fr...
Q: Write a program that reads a list of integers, and outputs whether the list contains all multiples o...
A: For the given scenario, the first element of the array is to be ignored while making a decision. So,...
Q: Can you demonstrate your understanding of the concept of physical data independence and its signific...
A: answer is
Q: Given a is a nonzero real number and n is a nonnegative integer. Write a program to compute d, using...
A: We need to write a program to compute alphan. Here, c language is used.
Q: Examine the benefits and drawbacks of decomposition-based integration.
A: With the assistance of a decomposition tree, it is possible to see how far integration testing has p...
Q: When it comes to database security, what is the difference between database security and system secu...
A: Introduction: System security protects a company's networks and resources from disruption, interfere...
Q: Create a file called toJSON that reads a .txt file from the command line. This file should always co...
A: Code :- var fs=require('fs'); //read command line args const args = process.argv.slice(2); //if arg...
Q: Given: NFA M1 = ({A,B,C}, {a,b}, delta, A, {C}) where delta: (A,a) -> {A}, (A,b) -> {A,B}, (B,a) ...
A: We are given a NFA and we are going to convert it to its equivalent DFA and then we will find out ho...
Step by step
Solved in 2 steps
- Java API has the GregorianCalendarclass in the java.util package, which you can use to obtain the year, month, andday of a date. The no-arg constructor constructs an instance for the current date, andthe methods get(GregorianCalendar.YEAR), get(GregorianCalendar.MONTH), and get(GregorianCalendar.DAY_OF_MONTH) return the year,month, and day. Write a program to perform two tasks:1. Display the current year, month, and day.2. The GregorianCalendar class has the setTimeInMillis(long), whichcan be used to set a specified elapsed time since January 1, 1970. Set the valueto 1234567898765L and display the year, month, and day.(1) Add an __init__ method to the Widget class below. Each object of type Widget should have an instance variable called name and an instance variable called cost that represents a cost in dollars; those values are passed in when an object of type Widget is initialized. (2) Add a method to class Widget called is_cheap that returns True if the cost is less than $10, and False otherwise. (3) Add proper doctrings along with two examples for each method. You may use the Sample Usage code given below in your work.A pet shop wants to give a discount to its clients if they buy one or more pets and at least five other items. The discount is equal to 20 percent of the cost of the other items, but not the pets. Implement a method: public static void discount(double[] prices, boolean[] isPet, int nItems) The method receives information about a particular sale. For the ith item, prices[i] is the price before any discount, and isPet[i] is true if the item is a pet. Write a program that prompts a cashier to enter each price and then a Y for a pet or N for another item. Use a price of –1 as a sentinel. Save the inputs in an array. Call the method that you implemented, and display the discount.
- **JAVA LANGUAGE** beginner level Suppose that a Scanner object contains a bunch of tokens all on a single line separated by spaces. For example: 100.5 30.4 pizza 56.8 1000.3 8.2 Also suppose that you have a particular item that you know the price of. Let’s use the following example: Kindle: 99.99 Write a static method: public static double priceIsRight(Scanner s, double price) that takes a Scanner and an item price as parameters and returns the bid that is closest to the item price but not greater than the item price. If all bids are greater than the price, return 0.0. If there are no bids (Scanner is empty) return 0.0. You can assume the Scanner is not null. In the above example. 56.8 should be returned, since it is the number that is closest to 99.99 but not over 99.99. Notice that there may be some invalid tokens in the Scanner's input. The above example has pizza as one of its tokens, which is clearly not a valid bid. Your method should throw these tokens away and not…1/ Write a BankAccountTester class whose main method constructs a bank account, deposits $1,000, withdraws $500, withdraws another $400, and then prints the remaining balance. Also print the expected result 2/ Implement a class Employee. An employee has a name (a string) and a salary (a double). Provide a constructor with two arguments public Employee(String employeeName, double currentSalary) and methods public String getName() public double getSalary() public void raiseSalary(double byPercent) These methods return the name and salary, and raise the employee's salary by a certain percentage. Sample usage: Employee harry = new Employee("Hacker, Harry", 50000); harry.raiseSalary(10); // Harry gets a 10 percent raise Supply an EmployeeTester class that tests all methods. 3/Implement a class Car with the following properties. A car has a certain fuel efficiency (measured in miles/gallon or liters/km—pick one) and a certain amount of fuel in the gas tank. The efficiency is specified in…Define the missing method. licenseNum is created as: (100000 * customID) + licenseYear, where customID is a method parameter. Sample output with inputs 2014 777: Dog license: 77702014 // ===== Code from file DogLicense.java =====public class DogLicense {private int licenseYear;private int licenseNum; public void setYear(int yearRegistered) {licenseYear = yearRegistered;} // FIXME: Write createLicenseNum() /* Your solution goes here */ public int getLicenseNum() {return licenseNum;}}// ===== end ===== // ===== Code from file CallDogLicense.java =====import java.util.Scanner; public class CallDogLicense {public static void main(String [] args) {Scanner scnr = new Scanner(System.in);DogLicense dog1 = new DogLicense();int userYear;int userId; userYear = scnr.nextInt();userId = scnr.nextInt(); dog1.setYear(userYear);dog1.createLicenseNum(userId);System.out.println("Dog license: " + dog1.getLicenseNum()); }}// ===== end =====
- Please ASaP. Complete method printPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 2, print "Too small". If greater than 10, print "Too large". Otherwise, compute and print 6 * bagOunces followed by " seconds". End with a newline. Example output for ounces = 7: 42 seconds import java.util.Scanner; public class PopcornTimer {public static void printPopcornTime(int bagOunces) { /* Your solution goes here */ } public static void main (String [] args) {Scanner scnr = new Scanner(System.in);int userOunces; userOunces = scnr.nextInt();printPopcornTime(userOunces);}} .Define the method outputValue() that takes two integer parameters and outputs the product of all negative integers starting with the first and ending with the second parameter. If no negative integers exist, product is 1. End with a newline. The method does not return any value. Ex: If the input is -4 7, then the output is: 24 Note: Negative numbers are less than 0. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import java.util.Scanner; public class ValuePrinter { publicstaticvoidmain(String[] args) { Scannerscnr=newScanner(System.in); intnumber1; intnumber2; number1=scnr.nextInt(); number2=scnr.nextInt(); outputValue(number1, number2); } }Define a method findFee() that takes one integer parameter as the person's age traveling by train, and returns the ticket price as an integer. The price is returned as follows: If a person's age is less than 4 or more than 80, price is $4. If a person's age is between 17 and 63, inclusive, price is $22. Otherwise, price is $16. Ex: If the input is 3, then the output is: import java.util.Scanner; public class TicketFinder { /* Your code goes here */ public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int personAge; personAge = scnr.nextInt(); System.out.println(findFee(personAge)); }}
- Make a python class called CellPhone. The init() method for CellPhone needs to store two attributes: brand, and model. Make two attribute called call_time (representing total calls duration) and txt_count (representing total text message count)which both start at 0 for each new CellPhone instance.Define a method named call() that gets a call duration and updates the call_time attribute, then prints out the total calls duration so far.Define another method named txt() that each time we call it just updates the txt_count attribute by adding 1 message to that, then prints the total message count so far.In the end, create a new instance of CellPhone and run each method once (use any number for call duration argument).Define a method findWinningPrize() that takes one integer parameter as the lottery number, and returns the prize as an integer. The prize is returned as follows: If lottery number is 178 or 286, prize is $6000. If lottery number is 296 or 446, prize is $12000. Otherwise, prize is $0. Ex: If the input is 178, then the output is: 6000Can you use it in a scanner so i can copy paste please. Part 1 A regular triangle is one for which all sides are congruent and all interior angles. Create a class RegularTriangle with a field side (int) Create a constructor which accepts an int parameter and will assign the parameter to field side Create assessor and mutator for this class Create a method getPerimeter() which should return 3*side; Part 2 in the constructor, add a logic that if the input parameter is less than 5 then set the side to 5, if it is >10 then set the side to 10, otherwise set the side to the input value. Screenshot final output