Question 15 What is the output of the following code? for r in range (1, 3): O O O for c in range (1, 2): print (c, end = '') print () 12 12 1 112 1 1 1 2 3 123 123
Q: Write a function (pseudocode is OK) to traverse binary search tree and return the ith node in sorted…
A: #include <iostream>using namespace std; // perform bubble sortvoid bubbleSort(int array[], int…
Q: How do you tell if binary data stored in a computer is a two’s complement number, a Gray code…
A: “Since you have asked multiple questions, we will solve the first question for you. If you want any…
Q: The Extended Euclidean Algorithm allows us to efficiently compute inverses in Z∗n (and also in…
A: Program Approach:- 1. Include header file 2. Create the user-defined function whose name is…
Q: This is incorrect
A: The given Python program is as follows: from random import * def main(): sets=int(input("Please…
Q: You have been asked to work as a usability consultant for a company where the development team has…
A: Solution : According to the International Organization for Standardization (ISO), this is the degree…
Q: works have played in dealing with the issue of the digital divide. Use specific exa
A: Introduction: As per the bartleby guidelines we can solve only question for you if you want to…
Q: Define function print_popcorn_time() with parameter bag_ounces. If bag_ounces is less than 3, print…
A: Solution- Giving the answer When defining the print popcorn time() function, provide the bag ounces…
Q: Which of the following recursive methods would return a value of 24 when mystery(3, 2) is called?…
A: The code is given below in Java
Q: QUESTION 10 Using the Cybersecurity Framework match the activity to the function ✓ Governance…
A: Solution- Given the solution helps us to know each given activty matches with its five given…
Q: Finding and replacing some data elements. b. Sorting data c. Searching va
A: Dear Student, Xlookup is usually used for - Searching a list of data for a specific value Looking up…
Q: Question 6 Write a Python program which accepts the length L of a square from the user then prints…
A: Here, I've accepted user input, transformed it to an int type, and placed it into a variable. I then…
Q: mplement a toString method for the following class that returns a string containing the class name…
A: The toString() method is used to get a String object representing the value of the Class Object.
Q: A web service returns data based on the information that it receives from the client. What HTTP…
A: The client can use the "Accept" header toinform the web service of the client'spreference. The…
Q: A retail company must file a monthly sales tax report listing the total sales for the month and the…
A: As language is not defined , doing it in python.
Q: What is constructive Interaction ?
A:
Q: What's the output of? #print("Hello, World!") Error O No output #print("Hello, World!") Hello,…
A: The Answer is " No output " because it is a comment. In python, we use # symbol for comment…
Q: Given the default schema of a database:
A: Introduction:- The database is a collection of records. The DBMS is a software that is used to do…
Q: public class ForgetfulCritter extends Critter XxX private String event; public void addHistory…
A: Ans. Inheritance in Java is the method to create a hierarchy between classes by inheriting from…
Q: Write a Python Program to define a new class from one or more existing classes as follows: a)…
A: Introduction: Inheritance in Python: Inheritance is a powerful feature in object-oriented…
Q: Consider a binary search tree implemented in Java with a node inner class as shown. The tree is…
A: Dear Student, The completed code is given below, it will return the largest key in the binary search…
Q: WorksOn Database: Employee (EmployeeNumber, EmployeeName, BirthDate, Title, Salary,…
A: Dear Student, SQL query for each question is given below and the queries are self explanatory.
Q: Let the Universal set be {1,2,3,4,5,6,7,8,9} Consider the subsets A = {1,2,3,7} B= {1,5,7,8,9} C =…
A: Answer is attached in step 2.
Q: For two functions f(n) and g(n), if there exist constants c, n >0 such that, for all n≥n, f(n) ≤c ·…
A: Asymptotic notations are used to measure the complexities of various algorithms.
Q: Q.18 Discuss about following computer factors. 1) Speed 11) Interface III) Widgets
A:
Q: he fairies in Fairyland are getting ready to compete in the Fly High game where the fairy that flies…
A: import random def main(): highest = 0 name = "" while True: fairy = input("Enter a…
Q: universal set subset empty set set element
A: I have given definition of all the terms with example in details below.
Q: Given the default schema of a database: Customers 123 Customerld noc FirstName noc LastName noc City…
A: The SQL program for the given problem is as follows: use demo;Create table Suppliers(SupplierId int…
Q: ow many leaves does a 3-ary tree have if its depth is 4? (HINT: see the pattern for a full binary…
A: To count the total number of nodes in 3-ary tree where depth is 4, for that calculation is given…
Q: Question 1 Suppose P packets arrive simultaneously to a link at which three packets are currently…
A:
Q: data structures
A: Given :- In the above question, the statement is mention in the above given question Need to…
Q: Write the Selection Structure that performs the following Selection: Price for a movie ticket: ages…
A: As language is not defined, doing it in Java.
Q: 4. Problem 4: Consider the function f(x, y) = cos(0.2(x - 1)² +0.5(y-2)2)e-²-y² 1) Plot the function…
A: # This is the code required for python plotting # Import libraries from mpl_toolkits import…
Q: Explain Basic flow of Particle Swarm Optimizationle Compare Pso & G. A (Grenetic Algorithm).
A: Particle swarm is a population-based algorithm. In this respect it is similar to the genetic…
Q: A computer has main memory access time of 500 ns or 500 x 10-9 seconds and cache memory access of…
A: As per our guidelines we are supposed to answer?️ only one question. Kindly repost other questions…
Q: Question 4 Identify the strongest (most secure) authentication factor among the 3 authentication…
A: The above question is solved in step 2 :-
Q: For this assignment you will be building on your Fraction class. However, the changes will be…
A: Here we have built a Fraction class. we also correctly handle Fractions that are negative, improper…
Q: ( Use C programming to solve this problem) Again, you have lost your USIS password!! You went to the…
A: For the given problem, below is the C code.
Q: What is exactly printed by this code? What is the output if we replace break into continue? for i in…
A: The question has been answered in step2
Q: 2. Problem 2: In this problem you will test our "in class" version of Gaussian elimination against…
A: SOLUTION
Q: 3:Explain collaborating via social networks and groupware.
A:
Q: Create a program that repeatedly displays a menu as a prompt, inputs the user’s choice and takes the…
A: 1) Since you have not specified programming language, I have written program in C programming,…
Q: 0-12. Multiple Exceptions: Add to the following code such that no unhandled exceptions occur. Look…
A: To handle all the exception, provided python code with proper exception handing and output below.
Q: Which of the following statements are true? A) When you open a file for reading, if the file does…
A: The true statements are:
Q: 1. How does the OS share resources among applications when multi-processing? 2. How does the OS…
A: Operating System "OS" System software that manages a computer's hardware and software resources and…
Q: Using 2’s complement perform the following a. DBC16 – BDA16b. 101010112 – 11000112
A: We need to perform subtraction using 2’s complement. As per the guidelines only 1st question is…
Q: Provide a different implementation of ChoiceQuestion. Instead of storing the choices in an array…
A: Inheritance is the property that allows to use the base class public methods in the child class.…
Q: Question 7 Manually construct a dedicated microprocessor to evaluate the factorial of n. The…
A: In this question we will answer about the microprocessor and algorithm.
Q: JAVA Implement the equals method of the Arrow class. Two arrows are equal when they have the same…
A: The equals(Object obj) method of Method class compares this Method Object against the specified…
Q: What is ergonomics?
A: Ergonomics is related to the performance of a system.
Q: Simplify the following function symbolically: AB+ A'C + BC
A: Digital electronic circuits operate with the voltages of two logic levels-namely Logic Low and the…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- Magic Squares One interesting application of two-dimensional arrays is magic squares. A magic square is a square matrix in which the sum of every row, every column, and both diagonals is the same. Magic squares have been studied for many years, and there are some particularly famous magic squares. In this exercise you will write code to determine whether a square is magic. File Square.java contains the shell for a class that represents a square matrix. It contains headers for a constructor that gives the size of the square and methods to read values into the square, print the square, find the sum of a given row, find the sum of a given column, find the sum of the main (or other) diagonal, and determine whether the square is magic. The read method is given for you; you will need to write the others. Note that the read method takes a Scanner object as a parameter. File SquareTest.java contains the shell for a program that reads input for squares from a file named magicData and tells…In Java can you help me fix what is missing MailBox- client:String- emails: Email[]- actualSize: int+ Mailbox()+ Mailbox(client:String)+ getClient(): String+ getEmail(int index): Email+ getActualSize(): int+ addEmail(email: Email): void+ sortEmailsByDate(): void+ findEmail(year:int: Email+ countUrgent():int+ toString(): String public class Mailbox { private String bradsInbox; private Email[] emails; privateintactualSize; public Mailbox() { Email[] emails = new Email[15]; actualSize = 0; } public Mailbox(String bradsInbox) { this.bradsInbox = bradsInbox; } public String getBradsInbox() { returnbradsInbox; } public Email[] getEmails() { returnemails; } publicint getActualSize() { returnactualSize; } publicvoid addEmail(Email email) { if (this.actualSize >= 15) { System.out.println("You have reached maximum capacity. Upgrade your account. "); } } publicvoid sortEmailsByDate() { } public Email findEmail(intyear) { for (inti = 0; i < this.actualSize; i++) {…I need help fixing this error within my p5js code : TypeError: undefined is not an object (evaluating 'se1.play') TypeError: undefined is not an object (evaluating 'se2.play') TypeError: undefined is not an object (evaluating 'se3.play') Here is my code: let se1, se2, se3; // declare sound variableslet ellipse1, ellipse2, ellipse3; // declare ellipse variables function preload() { se1 = loadSound('SE1.mp3'); se2 = loadSound('SE2.mp3'); se3 = loadSound('SE3.mp3');} function setup() { createCanvas(400, 400); ellipse1 = { x: 50, y: 50, size: 50 }; ellipse2 = { x: 150, y: 150, size: 50 }; ellipse3 = { x: 250, y: 250, size: 50 };} function draw() { background(220); noStroke(); fill(255, 0, 0); ellipse(ellipse1.x, ellipse1.y, ellipse1.size); fill(0, 255, 0); ellipse(ellipse2.x, ellipse2.y, ellipse2.size); fill(0, 0, 255); ellipse(ellipse3.x, ellipse3.y, ellipse3.size);} function mouseClicked() { // check if mouse is inside ellipse 1 if (dist(mouseX, mouseY, ellipse1.x,…
- In this programming challenge, you will create a simple trivia game for two players. The program will work like this: • Read the contents of the trivia.txt file into an ArrayList . • Starting with player 1, each player gets a turn at answering one trivia question. (For instance, if there are 10 questions, 5 for each player.) When a question is displayed, four possible answers are also displayed. Only one of the answers is correct, and if the player selects the correct answer, he or she earns a point. • After answers have been selected for all of the questions, the program displays the number of points earned by each player and declares the player with the highest number of points the winner, same as the sample execution. You are to design a Question class to hold the data for a trivia question. The Question class should have String fields for the following data: • A trivia question • Possible answer 1 • Possible answer 2 • Possible answer 3 • Possible answer 4 • The number of the…JAVAFX: Allowed functions for drawing (Ellipse2D,CubicCurve,QuadCurve,Arc2D) [draw all of these shapes please] ID ended with 0.1 ID ended with 2.3 ID ended with 4,5 ID ended with 6.7In main(), prompt the user for two items and create two objects of the ItemToPurchase class. Before prompting for the second item, call scnr.nextLine(); to allow the user to input a new string
- Write code that creates an ArrayList that can hold String objects. Add the names of three cars to the ArrayList, and then display the contents of the ArrayList.You have been provided with the following elements:• Sifiso• Ayanda• Andries• Tshegofatso• MarianneWrite a Java program in NetBeans that creates a TreeSet. Your Java program must use themethods in the TreeSet interface to do the following:• Add the above elements into the TreeSet• Display all the elements in the TreeSet• Get the last element in the TreeSet• Display elements that are greater than or equal “R” in the setThis is the question I am struggling on - Create a TeeShirt class for Toby’s Tee Shirt Company. Fields include: orderNumber - of type int size - of type String color - of type String price - of type double Create set methods for the order number, size, and color and get methods for all four fields. The price is determined by the size: $22.99 for XXL or XXXL, and $19.99 for all other sizes. Create a subclass named CustomTee that descends from TeeShirt and includes a field named slogan (of type String) to hold the slogan requested for the shirt, and include get and set methods for this field. This is the code I have done but I am not getting the right output- public class CustomTee extends TeeShirt { private String slogan; public void setSlogan(String slgn) { // write your code here slogan = slgn; } public String getSlogan() { // write your code here return slogan; } } ----------------------------------------- import java.util.*;…
- Where can you find MIN_VALUE and MAX_VALUE constants? Java doesn't have constants In StringTokenizer class In primitive data types In wrapper classesI have a problem on line 29 //On GLasses.cpp#include "Glasses.h" Glasses::Glasses(){color = "unknonw";prescription = 0.0f; } Glasses::Glasses(string color, float prescription){setColor(color);setPrescription(prescription);}Glasses::~Glasses(void) { } // behaviorsstring Glasses::toString(void){string strPrescription = to_string(prescription);strPrescription = strPrescription.substr(0, 4); return "Color: " + (color) + ", Prescription: " + (prescription);} // accessors and mutatorsstring Glasses::getColor(void){return color;}void Glasses::setColor(string color){if (color.length() > 0)this -> color = color;elsethis->color = "unknown";} float Glasses::getPrescription(void){return prescription;}void Glasses::setPrescription(float prescription){if (prescription > 0.0f)this->prescription = prescription; elsethis->prescription = 0.0f;}Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards, then backwards. End each loop with a newline. Ex: If courseGrades = {7, 9, 11, 10), print: 7 9 11 10 10 11 9 7 Hint: Use two for loops. Second loop starts with i = NUM_VALS - 1. Note: These activities may test code with different test values. This activity will perform two tests, both with a 4-element array (int courseGrades[4]). Also note: If the submitted code tries to access an invalid array element, such as courseGrades[9] for a 4-element array, the test may generate strange results. Or the test may crash and report "Program end never reached", in which case the system doesn't print the test case that caused the reported message. 1 #include HNm in 10 m DO G 2 3 int main(void) { 4 5 6 const int NUM_VALS = 4; int courseGrades [NUM_VALS]; int i; 7 8 for (i = 0; i < NUM_VALS; ++i) { scanf("%d", &(courseGrades[i])); 9 } 10 11 12 13 14 15 } /*Your solution…