After executing the following piece of code: z = 25 + 10j print(z.real) z = "apple" print(z.imag) what will we get? Select one: A. B. 10 0 25 AttributeError Traceback (most recent call last) in () 3 z = "apple" ----> 4 print(z.imag) AttributeError: 'str' object has no attribute 'imag' C. 25 0
Q: There are n bacteria and one virus in a Petri dish. Within the first minute, the virus kills one…
A: Given data: There will be n bacteria and 1 virus in 0 minutes. The virus then multiplies and kills…
Q: ) Using models and analytic techniques together with data access, providing features that make them…
A: Answer: We need to write the model and analytic to access the data by the non technical user so we…
Q: Q.4 Explain steps in genetic algorithm.
A: The above question that is explain steps in genetic algorithm is answered in below step.
Q: Consider two microprocessors having 32-bit and 64-bit wide external data buses, respectfully. The…
A: Solution: Option 'B' is the correct option. The 64-bit microprocessor is twice as fast.
Q: While (j≤n) sum := sum + j^2 j:=j+1 End-while The precondition is that n is a non-negative integer,…
A: Solution:
Q: Let us go back to the network we have been studying in the previous few homework assignments. Only,…
A:
Q: Please complete the exercise as instructed and do not use global variables. As well follow the…
A: Introduction: In this question, we are asked to write a funtion repeat_seperator(word, sep, n) in…
Q: For what values of the variable fold would the following code print ‘condition B’?
A: Given code: if fold > 2 : print(’condition A’) elif fold>100: print(’condition B’) if…
Q: RAM and 2K bytes of ROM along with interface unit of 128 registers each. A memory mapped is used.…
A: The answer is
Q: Construct a complete multiple queue process scheduler that compiles in C. Be sure to comment…
A: Introduction Processes in the ready queue may be categorized into multiple classes, each of which…
Q: What is the decimal number 550069 in base 23? (Hint: use the ascii array from A1!) What is the…
A: Decimal to other Base:
Q: If we create a function such as: def triple(data): return data * 3. What of the following options…
A: Complete answer is below in python program:
Q: Match the correct stage of compilation on the left to the description of what occurs at the step…
A:
Q: Which of the following terms refers to the actions performed by a user on a file or a process to…
A: Process:- A process is a program that is being run and is more than just a text piece of the program…
Q: ries. = 4 − 3 + - + - + ... ur program will prompt the number of terms in the series to use for the…
A: The answer is given below.
Q: What feature of Google/Apple Maps would you like to alter or add? Explain in both words and…
A: Google and Apple Maps:- Navigational aids like Google Maps and Apple Maps have transformed how we…
Q: Given the following recursive method and function call, how many recursive calls are made, excluding…
A: 4 recursive calls.
Q: Handles IP Addressing Delivery, three-way handshake basic transport layer functions
A: The answer is given below.
Q: Q.5 What is Bernoulli naive Bayes? Explain mean and variance.
A:
Q: Write a program to generate a table of conversions from dollars to pesos, South African rand, and…
A: The rate of conversions from dollar to peso is as follows Dollar Peso 1 9.02 The rate of…
Q: b) Solve the following equation assuming y is the variable to be found: 2x-3x²+15x-8+ In(y) - 2.
A: Here is the matlab code of the above problem. See below steps.
Q: Decode the following ASCII message, assuming 7-bit ASCII characters: 1001010 1101111 1100010 1100101…
A: Answers:- 1001010 is decimal = 74 is ASCII characters = J 1101111 is decimal = 111…
Q: Q.1 Explain Particle Swarm Optimization.
A: Introduction: Particle Swarm Optimization (PSO) is a 1995 optimization approach developed by Kennedy…
Q: What type of recursion is present in the method below? public static void mystery (int x, int y) {…
A: When making decisions, if-else statements are used to describe which block of code should be run…
Q: Repeating group data cannot exist in tables that are normalized at the 2NF level. True False
A: A group of fields or characteristics that appear repeatedly in a database table is known as a…
Q: Q.8 What is empirical risk minimization?
A:
Q: Create a function that will return the sum, average, maximum value, and minimum value of a given…
A: Swift language introduction:- Swift is a brand-new programming language for creating apps for iOS,…
Q: Suppose you have an unsorted array A of n elements and we want to know if A contains any duplicate…
A: To keep track of the number of times an element occurred, we can create an additional array (Let B)…
Q: Regarding the deep belief network, can it better control the “chance-driven” error of restricted…
A: Boltzmann machine The locality, Hebbian nature, parallelism, and likeness of Boltzmann machines'…
Q: A computer employs RAM chips of 512 x 16 and ROM chips of 1024 x 8. The computer system needs 4K…
A: Computer Memory which refers to the location of short-term data, while in the storage which refers…
Q: RAM and 2K bytes of ROM along with interface unit of 128 registers each. A memo
A: The answer is
Q: MALWARE DESCRIPTION HOW IT IS TRANSMITTED IMPACT
A: The above question that is explain the 4 malwares found from your search and the malware description…
Q: Hello! Need help with my Java Homework Please use Eclipse and Add a comments in each program to…
A: According to the information given:- We have to follow the instruction in order to implement the…
Q: I am sorry but you did not provide the answer to the problem!!!
A: The range() method in Python creates an immutable sequence of numbers beginning with the provided…
Q: #16) Write a recursive C++ or Python function that finds the minimum and maximum values in an array…
A: Answers:- Code;- def Minmum(a, n): if(n==1): return a[0] else: return…
Q: So the answer would be yes?
A: We need to check if deep belief network once trained, can be used in supervised learning problems…
Q: Baby btc program - python Budget: $75,000 Make a string based bitcoin menu which shows the price…
A: Program Approach: Step 1: Take the balance amount in USD from the user and store it in a variable…
Q: Q.7 Explain Support Vector Machine ? What is two class problems?
A:
Q: Please enter an integer value: 100 Please enter an integer value: 23 Please enter an integer value:…
A: The answer is given below.
Q: What is the velocity update equation of PSO?
A:
Q: What is Dynamic Time Warping in algorithms.
A: Here in this question we have asked about dynamic time warping in algorithm.
Q: Q.9 What is Bagging? Explain Bagging steps. List its advantages and disadvantages.
A:
Q: what type of Big O time complexity is O(a * b) ? Does O(a * b) reduce to O(a) = O(n)/linear?
A: Does O(a * b) reduce to O(a) = O(n)/linear? Answer: No, a*b will take constant time so it is not an…
Q: Given the following code segment: for n in range(x, y, z): print(n) Which of the following values…
A: Here is the explanation of the above problem. See below steps.
Q: Please do it with regular expression. Don't use loops please. Do fast, I have no time left Write a…
A: In this question we need to write a Java program to check whether a string entered by user contains…
Q: Basis step: (0,0) = S Recursive step: If (a, b) € S, then (a +2, b+3) € S and (a +3, b+ 2) € S. (a)…
A: Solution: Given: 0, 0∈S a+2, b+3 whenever a, b∈Sa+3, b+2 whenever a,…
Q: n logan +n log₂ 12 3 logs n + log₂ log₂ lo 100n +0.01²
A: Solution - In the given question, we have to determine dominant term and big O for the given…
Q: *23.13 (EXECUTION TIME FOR SORTING) Write a program that obtains the execution time of selection…
A: SORTING ALGORITHMS:- Rearranging an array or list of elements according to a comparison operator on…
Q: In C Program (Insertion Sort) Write a program that sorts the values inside the array in ascending…
A: Introduction: In this question, we are asked to write a C program for the insertion sort.
Q: Implement binary search algorithm recursively on a list using F# Full explain this question and…
A: Solution: Introduction Binary Search-:Binary search is a useful method for locating an element in 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:
Step by step
Solved in 3 steps with 2 images
- This is the question I am stuck on - A. Create a CollegeCourse class. The class contains fields for the course ID (for example, CIS 210), credit hours (for example, 3), and a letter grade (for example, A). Include get and set methods for each field. Create a Student class containing an ID number and an array of five CollegeCourse objects. Create a get and set method for the Student ID number. Also create a get method that returns one of the Student’s CollegeCourses; the method takes an integer argument and returns the CollegeCourse in that position (0 through 4). Next, create a set method that sets the value of one of the Student’s CollegeCourse objects; the method takes two arguments—a CollegeCourse and an integer representing the CollegeCourse’s position (0 through 4). B. Write an application that prompts a professor to enter grades for five different courses each for 10 students. Prompt the professor to enter data for one student at a time, including student ID and course data for…How many objects are ready to be garbage-collected after executing the following code? Rectangular Snip Pokemon m1 = new Pokemon ("Pikachu", 35); Pokemon m2 = new Pokemon ("Seel", 65); Pokemon m3 = new Pokemon ("Rikachu", 25); m1 = m2; m2 = m3; %3D m3 = m1;This is the question I am stuck on - A. Create a CollegeCourse class. The class contains fields for the course ID (for example, CIS 210), credit hours (for example, 3), and a letter grade (for example, A). Include get and set methods for each field. Create a Student class containing an ID number and an array of five CollegeCourse objects. Create a get and set method for the Student ID number. Also create a get method that returns one of the Student’s CollegeCourses; the method takes an integer argument and returns the CollegeCourse in that position (0 through 4). Next, create a set method that sets the value of one of the Student’s CollegeCourse objects; the method takes two arguments—a CollegeCourse and an integer representing the CollegeCourse’s position (0 through 4). B. Write an application that prompts a professor to enter grades for five different courses each for 10 students. Prompt the professor to enter data for one student at a time, including student ID and course data for…
- This is the question I am stuck on - A. Create a CollegeCourse class. The class contains fields for the course ID (for example, CIS 210), credit hours (for example, 3), and a letter grade (for example, A). Include get and set methods for each field. Create a Student class containing an ID number and an array of five CollegeCourse objects. Create a get and set method for the Student ID number. Also create a get method that returns one of the Student’s CollegeCourses; the method takes an integer argument and returns the CollegeCourse in that position (0 through 4). Next, create a set method that sets the value of one of the Student’s CollegeCourse objects; the method takes two arguments—a CollegeCourse and an integer representing the CollegeCourse’s position (0 through 4). B. Write an application that prompts a professor to enter grades for five different courses each for 10 students. Prompt the professor to enter data for one student at a time, including student ID and course data for…Use this code template to continue the code: public Item(String name, double weight, int value) Initializes the Item’s =ields to the values that are passed in; the included =ield is initialized to false public Item(Item other) Initializes this item’s fields to the be the same as the other item’s public double getWeight() public int getValue() public boolean isIncluded() Getter for the item’s fields (you don’t need a getter for the name) Given code: public class Item { private final String name; private final double weight; private final int value; private boolean included; public Item(String name, double weight, int value) { this.name = name; this.weight = weight; this.value = value; } public Item(Item item){ name = item.name; weight = item.weight; value = item.value; } public void…1: Create a new class with attributes name and address. Both data type will be String. Create a constructor and assign the parameters to the attributes. Now override the toString() method. Is this possible? 2: Create a class with the main method and create an instance of the class that you created in Test Stem 1. What method can you call to get the hashCode of your class? 3: What is the return type of the hash code ? 4: Create an instance of the string in your test class and assign a value. Which of the following operators can be used in conjunction with a string object? + - & . += 5: Supposed that we have a string with a value “This is my string.”. Which method can be used to extract a specific word from the given string? 6: Supposed that we have a string with a value “This is my string.”. Which expression can be used to extract the word “my” from the given string? 7: Now create an String and assign a value with spaces in the beginning, end and middle. Try out the method…
- Modified Circle class and test file: Add a new attribute for color (or any other new attribute) Add get/set methods for this new instance variable, including data validation in set method (assuming background is black, i.e. circle color can't be black, reset to any non-black color if black is entered ). Add a new constructor to pass the color attribute as an argument. Add an instance method to display all properties of a Circle object. Create 2 objects using different constructors in test file, with invalid data. Use this test java file test java file: class CircleTest{ public static void main(String[] args){ int num = 10; Circle c1 = new Circle(0.001); Circle c2 = new Circle("black", -9); c1.display(); c2.display(); c1.setRadius( -1); c1.setColor("black"); c1.display(); }}use this code template to help you continue: private boolean included Indicates whether the item should be taken or not public Item(String name, double weight, int value) Initializes the Item’s fields to the values that are passed in; the included Field is initialized to false public Item(Item other) Initializes this item’s fields to the be the same as the other item’s public void setIncluded(boolean included) Setter for the item’s included field (you don’t need setters for the other fields) Given code: public class Item { private final String name; private final double weight; private final int value; public Item(String name, double weight, int value) { this.name = name; this.weight = weight; this.value = value; } static int max(int a, int b) { if(a > b) return a; return b; } // function to print the items which are taken static void printSelection(int W, Item[] items, int…The code given below represents a saveTransaction() method which is used to save data to a database from the Java program. Given the classes in the image as well as an image of the screen which will call the function, modify the given code so that it loops through the items again, this time as it loops through you are to insert the data into the salesdetails table, note that the SalesNumber from the AUTO-INCREMENT field from above is to be inserted here with each record being placed into the salesdetails table. Finally, as you loop through the items the product table must be update because as products are sold the onhand field in the products table must be updated. When multiple tables are to be updated with related data, you should wrap it into a DMBS transaction. The schema for the database is also depicted. public class PosDAO { private Connection connection; public PosDAO(Connection connection) { this.connection = connection; } public void…
- Add a list of procedures in your patient class, fill them and print them with the patient data. This is called composition which is a "has a" relationship. A patient has procedures. Write a class named Patient that has attributes for the following data: First name, middle name, and last name Address, city, state, and ZIP code Phone number Name and phone number of emergency contact The Patient class’s _ _init_ _ method should accept an argument for each attribute. The Patient class should also have accessor and mutator methods for each attribute. Next, write a class named Procedure that represents a medical procedure that has been performed on a patient. The Procedure class should have attributes for the following data: Name of the procedure Date of the procedure Name of the practitioner who performed the procedure Charges for the procedure The Procedure class’s _ _init_ _ method should accept an argument for each attribute. The Procedure class should also have accessor and mutator…Please written by computer source What will the application do? Display a set of at least 6 cars (at least 3 new and 3 used) along with Add and Quit options Let the user select one of the cars. Ask if they want to buy the car. If they enter yes, remove it from the list. If they want to add another car to the list, get the details, create a new instance of the appropriate class (Car class for new cars, or UsedCar), and add it to your data collection. Keep looping until they choose to quit. Build Specifications If your instructors tells you to work in pairs, stay with your assigned pair for this lab. Create a class named Car to store the data about a car. This class should contain:Data members for car details A string for the make A string for the model An int for the year A decimal for the price A no-arguments constructor that sets data members to default values (blanks or your choice) A constructor with four arguments matching the order above Properties for all data members An…This is the question that is confusing me - A. Create a CollegeCourse class. The class contains fields for the course ID (for example, CIS 210), credit hours (for example, 3), and a letter grade (for example, A). Include get and set methods for each field. Create a Student class containing an ID number and an array of five CollegeCourse objects. Create a get and set method for the Student ID number. Also create a get method that returns one of the Student’s CollegeCourses; the method takes an integer argument and returns the CollegeCourse in that position (0 through 4). Next, create a set method that sets the value of one of the Student’s CollegeCourse objects; the method takes two arguments—a CollegeCourse and an integer representing the CollegeCourse’s position (0 through 4). B. Write an application that prompts a professor to enter grades for five different courses each for 10 students. Prompt the professor to enter data for one student at a time, including student ID and course…