java
Q: QUESTION 4 a d. Given the tree above, show the order of the nodes visited using recursive post-order...
A: Postorder traversal: For traversing a (non-empty) binary tree in a postorder fashion, we must do the...
Q: please help me thank you
A: Here we will discuss the difference in 8-ary QAM and 8-ary CAM
Q: Draw a flowchart or write pseudocode to represent the logic of a program that allows the user to ent...
A: Flowchart
Q: What is the worst-case running-time of the isConnected function below which tests whether a graph G ...
A: c. O(n2)
Q: 1) The mortality rate for a certain disease is 6 per 1000. What is theprobability for just four deat...
A: NOTE: ACCORDING TO COMPANY POLICY WE CAN ONLY SOLVE 1 QUESTION. YOU CAN RESUBMIT THE QUESTION AGAIN ...
Q: What is true about the UDP protocol?Group of answer options The UDP header contains source and desti...
A: EXPLANATION: UDP stands for User Datagram Protocol. This protocol basically lets the transmission o...
Q: question 4
A: Explanation The internet is millions of computers linked by thousands of networks while the world wi...
Q: database HR Select employee first name, concatenate it with job, find length of department id, find...
A: Select employee first name, concatenate it with job, find length of department id, find location of ...
Q: Given two fuzzy set A and B A = {(x1,0.5), (x2,0.1), (x3,0.4)} B = {(x1,0.2), (x2,0.3), (x3,0.5)} Wh...
A: In the given question A = {(x1, 0.5), (x2, 0.1), (x1, 0.4)}B = {(x1, 0.2), (x2, 0.3), (x1, 0.5)} Bot...
Q: c++ programming Given the following functions: void sum(int a, int b) { cout << a+b <<...
A: In the given program the function sum is defined twice. In the first function, the return type is vo...
Q: In object-oriented design approach everything is in terms of objects. How a large (or complex) objec...
A: Object-oriented decomposition is the concept upon which OOA and OOD are based. It can be achieved u...
Q: int X[900]; int Y[600]; int sum, sum1, sum2, sum3; //parallelism : dividing outer loop in thre...
A: int X[900]; int Y[600]; int sum, sum1, sum2, sum3; //i = 1 to 900 for(i=1;i<=900;i++) ...
Q: question 49/50
A: 1) A Any problem can be solve algorithmically, though some solution may require humans to validate t...
Q: c++ programming
A: Given:- c++ programming
Q: c++ Write a nested loop to print the following for any n x n image of odd dimensions:Example Output ...
A: for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if (i==0) cout<<...
Q: Write pseudo code to find fitness value function of 5-queens problem. (Add a text file, Use Indentat...
A: First of all N-Queen problem is the problem where we need to find an arrangement of N queens on the ...
Q: 1. Write a function named “getSumBeforeNegative” that takes in a pointer to the array of integers an...
A: Given: 1. Write a function named “getSumBeforeNegative” that takes in a pointer to the array of inte...
Q: 3) Assign a Value to x to the Value of acconding n aš fellows 1f 0<れS1O otherise (n<o
A: CODE:- #include <iostream>using namespace std;int main(){ int x,n; cout<<"input"; ...
Q: Calculate the ALE of a threat that can be expected to occur three times per year and will cost $5000...
A: Given : Calculate the ALE of a threat that can be expected to occur three times per year and will co...
Q: A local area network (LAN) spans a geographical area that is a) Vast b) Widespread c) Limited d) Glo...
A: The (LAN) or the local area network is defined as the network of computers that are connected to eac...
Q: i need the answer of below question in 30 minutes. Overload the following opereator in C++ >, <...
A: Overload the following opereator in C++ >, <, >=, <= and ==
Q: Create a java program to implement all the queue operations using either array or linked list. The r...
A: Given data is shown below: Create a java program to implement all the queue operations using either ...
Q: Provide a reasonable description of the sample space. There can be more than one acceptable interpre...
A: ASSUMPTIONS AND EXPLANATION: The major assumption is that the given scale can measure upto the valu...
Q: Consider the following matrix: P = [3 6 9 12; 4 8 12 16; 3 6 9 12] What Octave command will you...
A: P = [3 6 9 12; 4 8 12 16; 3 6 9 12] P(:,4)=2 disp("The Values after replacing the last column to 2")...
Q: write a python function that will read data from a file, store it in a matrix, and return it
A: Program Description: Write a python function that will read data from a file, store it in a matrix...
Q: How do you compare Categorical Cross-Entropy with Binary Cross-Entropy ?
A: Cross-entropy is a commonly used loss function for classification tasks.
Q: In this exercise, you will code a modified version of sequential search from the previous example. H...
A: Given: In this exercise, you will code a modified version of sequential search from the previous ...
Q: what will be the new root
A: Correct option: C
Q: I want the code by java
A:
Q: True or False: The first thing you should do when youencounter a computer system in a forensic inves...
A: False.
Q: 1. (a). Illustrate how Bubble sort will sort the following elements of the array a[6] in ascending o...
A: <30,80,20,45,65,50>-given array Bubble sort compares first two elements if first element>se...
Q: What is the domain of a function that assigns to a 16-bit bit string the number of zero bits in the ...
A: the value of domain of a function that assign bit string the number of zero bits in string is given ...
Q: In general, in an avl tree, worst case for finding (and inserting and deleting) data takes: ...
A: Due to the balancing property, the insertion, deletion and search operations take O ( l o g n ) O(lo...
Q: Using function(s), write a C++ program that computes the positive and negative sums of a set of MAXN...
A: We have to ask the user 5 numbers and and then find the average of positive and negative number and ...
Q: c++ PLEASE TRACE THE FUNCTION Given the code:void d(int n) { if(n<2) { cout << n ...
A: Function: When we first time called d(12) it will print 12 and then call d(12/3) i.e d(4) when d(4...
Q: P2a: Whats printed in main? int main() { char a = 'h'; char b - 't'; char c= 'x'; char d = 'w'; char...
A: OUTPUT will be: twix
Q: Please follow all the steps given
A: Code: import mathdef encode(string, rows): columns = math.ceil(len(string) / rows) e_matri...
Q: Write a c++ code and test the “digit” function:Function Prototype: int digit(int n,int k)This functi...
A: int digit(int n,int k){ string str; str = to_string(n); if(k>=str.length()) return -...
Q: make a example code related to orginizing files in python . Save it as 201916791. py and take a pi...
A: Python programming language is the high-level interpreted programming language, It's also used to bu...
Q: Think of an example (real or hyphotical) of a speech, a sales presentation, a news broadcast, or tel...
A: Given: Think of an example (real or hyphotical) of a speech, a sales presentation, a news broadcast,...
Q: please do Scheme language #3. Show/and document (explain) Factorial (n) using recursion
A: Given: please do Scheme language #3. Show/and document (explain) Factorial (n) using recursion
Q: Consider the following array: x = [1,2,3,4,5;6,7,8,9,10;11,12,13,14,15;16,17,18,19,20] What Octave c...
A: Define variable x and write down the elements of the array within it enclosed by square brackets. Fi...
Q: Q15/ Write a program in c++ to display the message: "PROCEED" or "ABORT" depending on the input. If...
A: Write a program in c++ to display the message: "PROCEED" or "ABORT" depending on the input. If the ...
Q: Question 3How binary search is different from linear search? Use following list of item and search 1...
A: Given: Question 3How binary search is different from linear search? Use following list of item and s...
Q: A matrix for rugby results shows the number of conversions, drop goals and penalties for three teams...
A: Question given: A matrix of size (3,3) stores number of conversion, drop goals and penalty by 3 team...
Q: this is for c++ Given the code:char letter = 'A';Write a single line of code to convert and print th...
A: cout << "ASCII Value of " << letter << " is " << int(letter);
Q: course: Data communication and communication Networks Q: Compare the different TCP variants (Tahoe, ...
A: Given:- course: Data communication and communication Networks Q: Compare the different TCP variants ...
Q: Ctt Inventory Program Menu 1. ADD NEW Record 2. DISPLAY Record 3. MODIFY Record 4. EXIT Pro...
A: code here: #include<iostream> #include<fstream> using namespace std; typedef struct in...
Q: Explain how both the Waterfall model and the Prototyping model of the software process can be accomm...
A: The waterfall model is accommodated where there is a low specification risk and no need for prototyp...
Q: the formula is given, please solve the Question
A: Answer: using System;using System.Collections.Generic;using System.Linq;using System.Text;using Syst...
Problem 2. Write a java
Note:
The channel and volume level are not changed if the TV is not on. Before either of these is changed, its current value is checked to ensure that it is within the correct range. Listing 4 gives a program that uses the TV class to create two objects.
Set Channel to 40 and Set Volume t0 5
Find out TV1 Channel and Volume, and
Find out TV2 Channel and Volume?
Filename: Encapsulation2.java
Step by step
Solved in 2 steps with 1 images
- Java - Access Specifiers Create a class named Circle that has attributes radius, area, and circumference and make the attributes private. Make a public method that sets the radius and a method that prints all attributes. Ask the user input for radius. Note: Use the PI from the math functions Inputs A line containing an integer 10 Sample Output Radius: 20 Area: 1256.64 Circumference: 125.66subject: object-oriented programming in your library there are two types of books. one category is literature books and the second category is generals. litrature books have the authorID, authorname literature theme language, publisher, volumn,, yearofpubication, journal have attributes volumn, issue, publisher,yearofpublication,journalID, technical sponser. design a parent class books extend two classes literaturebooks and journel from parent class make constructor , setter, and getterwrite a program using java Create a class for Subject containing the Name of the subject and score of the subject. There should be following methods: set: it will take two arguments name and score, and set the values of the attributes. If score is less than 0 or greater than 100.0 then a message should be displayed “Incorrect score” and score should be set to Zero. set: it will take one double value as argument and set the value of score only. If score is less than 0 or greater than 100.0 then a message should be displayed “Incorrect score” and score should be set to Zero. display: it will display the name and score of the subject. Like “Name : Math, Score: 99.9” getScore: it will return the value of score. greaterThan: it will take subject’s object as argument, compare the calling object’s score with argument object’s score and return true if the calling object has greater score. Create a class “Main” having main method to perform following tasks. Create two objects of Subject…
- Instruction Write a class Car that contains fields “make”, “model” and “year.” The first two fields are Strings and the third one is an int. Define a constructor to accept and initialize instance data. Then define more methods(see code below). A toString method is included to print the description of the car. Then create a drive class called CarTest which has a main method. Portion of the program is given. You’ll complete the program. When you run CarTest the result should look like this: > run CarTest 2007 Ford Taurus 2011 Honda Odyssey 1999 Toyota Corolla 1966 Ford Mustang Update data! 2007 Ford Explorer 2010 Honda Odyssey 1999 Nissan Maxima 1966 Ford Mustang Student Here! Hi, I've tried typing the code (The screenshots attached) but kept getting errors. Im not sure what to do so I hope that you can help me! Thank You!Write a program using java Create a class for Subject containing the Name of the subject and score of the subject. There should be following methods: set: it will take two arguments name and score, and set the values of the attributes. If score is less than 0 or greater than 100.0 then a message should be displayed “Incorrect score” and score should be set to Zero. set: it will take one double value as argument and set the value of score only. If score is less than 0 or greater than 100.0 then a message should be displayed “Incorrect score” and score should be set to Zero. display: it will display the name and score of the subject. Like “Name : Math, Score: 99.9” getScore: it will return the value of score.write a c++ program Write a class Date that represents a date consisting of a year, month, and day. A Date classshould have the following methods:# Date(int year, int month, int day)Constructs a new Date object to represent the given date.# void add(int &days)Moves this Date object forward by the given number of days. hint:* you should decideon the basis of month and year that given month ends 30,31,28,29 days.# void add(int &month , int &days) Moves this Date object forward by the given number of months and days. Monthsshould be within 1 to 12 and days in 1 to 31. For Example Date 2003/12/31andadd(1,29) =>Date will be 2004/02/29# void add(Date & other)Moves this Date object forward by the given Date.# void addWeeks(int &weeks)Moves this Date object forward by the given number of seven-day weeks.# int daysTo(Date & other)Returns the number of days that this Date must be adjusted to make it equal to the givenother Date.# void subtract(int &days)Moves this…
- DescriptionIn this assignment, you are required to implement an electronic programming quiz system. User can createquestions and preview the quiz.Your TaskYou are asked to write a Java program for the programming quiz system. There are two types of questions:Multiple Choice Question and Ture/False Question. User can create questions using the system; andpreview the quiz, which display all questions in the system one by one. During the preview, the user canattempt the quiz by entering his/her answers to questions. The system will then immediately check theanswer and calculate. After attempting all questions, the total score will be displayed. A sample run of theprogram is shown as below (Green text refers to user input): Please choose (c)reate a question, (p)review or (e)xit >> cEnter the type of question (MC or TF) >> MCEnter the question text >> Each primitive type in Java has a correspondingclass contained in the java.lang package. These classes are called…Java Object Oriented Programming Create a Shape class that shall have color and filled instance variables of enum Color and boolean type. The filled boolean variable shall show, whether the shape is filled (colored). The enum Color shall be defined within the class having 4 color names (choose any four). Also define getArea and getPerimeter method in Shape class, both shall return 0. Create Rectangle class with length and width attributes and a Circle class with radius attribute, of type double. Properly encapsulate all fields. Circle and Rectangle shall extend Shape class and override getArea and getPerimters methods as per its type and specific formula. In Test class, create an object of Rectangle and Circle, by initializing all attributes in constructor and print both shapes' area and perimters. In Test class, define a static method with following signature, public static void printEachShapeCount(Shape... shapes) As you know, the parent type variable can hold the…Java Programming problem Create a checking account class with three attributes: account number, owner’s name, and balance. Create constructor, getters and setters. If one is to set the initial balance of an account as a negative value in a setter or a constructor, remind the user about the error and set it as 0. Create a CheckingAccountDemo class, and create a main method in which Ask for the name, account number, and initial balance for one account from the keyboard input. With these input values as arguments in a call to the constructor, create a CheckingAccount object. Print the summary of this account that includes information on the name, account number, and balance by calling the getters.
- Exercise 2. Write a driver class to test the Item class as follows: a. Generate 3 Item objects using the all parameters constructor, let the user input all required data. b. Ask the user to input the frequency for each object. c. Print the 3 Items using the display method. Sample Run: Enter code, name, price of Object 1: E001 iPhonell 750 Enter code, name, price of Object 2: FO01 Table 500 Enter code, name, price of Object 3: A001 AirPodPro 230 Enter frequency of object 1: h Enter frequency of object 2: L Enter frequency of object 3: a The price of the item iPhone 11 (E001) is 750, its final price is 600 The price of the item Table (FO01) is 500, its final price is 475 The price of the item Air Pod Pro (A001) is 230, its final price is 230Design and implement a class dayType that implements the day of the week in a program. The class dayType should store the day, such as Sun for Sunday. The program should be able to perform the following operations on an object of type dayType:a. Set the day.b. Print the day.c. Return the day.d. Return the next day.e. Return the previous day.f. Calculate and return the day by adding certain days to the current day. For example, if the current day is Monday and we add 4 days, the day to be returned is Friday. Similarly, if today is Tuesday and we add 13 days, the day to be returned is Monday.g. Add the appropriate constructors.write a java program This composition example contains classes Date, Employee and EmployeeTest .Class Date declares instance variables month, day and year to represent a date. The constructor receives three int parameters. It has checks to validate the month—if the value is out-of-range the method throws an error message, same goes for day. Provide getters, setters and toString method. Class Employee has instance variables firstName, lastName, birthDate and hireDate. firstName and lastName are references to String objects. Members birthDate and hireDate are references to Date objects. • The Employee constructor takes four parameters—first, last, dateOfBirth and dateOfHire. Initialize the hireDate and birthDate with these objects by calling its constructor and setters. • When class Employee’s toString method is called, it returns a String containing the employee’s name and the String representations of the two Date objects. Each of these Strings is obtained with an implicit call…