1:02 PM COmputer ScieNTE QUESTIONS ama answers/ What is... '@ Question: What is the output of the following code? class Mairn public static void... What is the output of the following code? class Main public static void main(String args []) String abc "Welcome to Chegg"; String xyz new String(abc); if (abc xyz) System.out.println( (abc xyz) + else System.out.println( (abc xyz) a. 10 0 true c. false true d. true true Show transcribed image text Get this answer with Chegg Study SEE THE ANSWER
Q: Analyze the code snippet below: package package1;import java.io.BufferedReader;import java.io.IOExce...
A: There is only one class involved in this code.The class name is: WebPageTextReader.Explanation:After...
Q: Construct a truth table for the following: a) xyz + x(yz)' + x'(y+z) + (xyz)'b) (x + y')(x' + z')(y'...
A: Truth table:a. Given Boolean expression:F = xyz + x(yz)’ + x’(y + z) + (xyz)’
Q: In C++ and using command line arguments, how do you check if an argument is a double or integer?
A: The command line argument is of char* type. Hence, both double and integer values may seem same if t...
Q: Write a program that uses the following menu to keep track of student information: 1) Enter a studen...
A: Python program to keep track of student informationProgram IntroCreate a menu using printf() functio...
Q: What folder contains group policy templates, logon/logoff scripts, and DFS synchronization data? Gro...
A: “System Volume (SYSVOL)” folder contains group policy templates, logon scripts, and Distributed File...
Q: Write a program that reads integers from a file, sums the values and calculates the average. Write...
A: The below given C++ program will obey the following rubrics:Importing essential header files.Definin...
Q: Why did Cisco systems transition from a standalone access control system to an IP networked systems...
A: Standalone control systems:Basic access control systems.Used at a single location.Not networked with...
Q: EXPLAIN ALL STEPS: Convert the following assembly language instructions into hexadecimal machine lan...
A: Here user want to do a conversation of assembly language into hexadecimal. So, going ahead our duty ...
Q: Given the follwing business rules, create an Crows Foot ERD. The ERD must include all primary keys,...
A: The crow’s foot diagram shows the entities as the boxes and relationship as the lines between the en...
Q: Implement the following two methods in javascript: String multiply2(String num) - return num*2 wit...
A: Program Instructions:In the function multiply2(), take one digit at a time, multiply it by two, and ...
Q: Write down a Unix command that will change security permissions on a file named file1.txt so that th...
A: Ownership of filesUser (u): A person who creates the file. User is also known as owner of the file.G...
Q: ABC Accounting Company is a company that manages the financials for various small companies on a nat...
A: 1) To prevent remote employees from being hacked, the following steps can be taken:A Virtual private...
Q: Some system analysts maintain that source doucments are unnecessary. They say that all input cab be ...
A: “Yes”, any user can agree with the given statement.
Q: Please use Python Write a program that determines the cost of painting the walls of a windowless roo...
A: Below is the approach and code of a python program to calculate the cost of the painting of windowle...
Q: Write a simplified expression for the Boolean function defined by the following Kmap.
A: Answer:Given K-map:
Q: consider the udp header 12 03 00 0f 00 1e a3 10. what is the total length of the udp?
A: The User Datagram Protocol (UDP) is a transport layer communication protocol in the TCP/IP model.The...
Q: help make the truth table for this question. Given two 2-bit two’s complement numbers A and B, pr...
A: Instructions to follow:Since the numbers A and B are 2-bits two’s compliment numbers, they can be re...
Q: If originally x = 4, y = 0, and z = 2, which is the value of x, y and z after executing the followin...
A: Code(in Java)-class Main{ public static void main(String[] args) { ...
Q: <pre>SELECT CUSTOMER_T. CUSTOMER_ID,ORDER_T. CUSTOMER_ID, NAME, ORDER_IDFROM CUSTOMER_T,ORDER_...
A: SELECT CUSTOMER_T. CUSTOMER_ID,ORDER_T. CUSTOMER_ID, NAME, ORDER_IDFROM CUSTOMER_T, ORDER_TWHERE CUS...
Q: Based on the given block data below, answer the following questions. Hint: First do Google search fo...
A: Q1. (Layer 4) Protocol is:Based on the above input data block result, the Protocol used in layer 4 (...
Q: Question 5, output in C++
A: C++ PROGRAM:#include<iostream>void swap(int a, int b) {int tmp = b;b = a; a = tmp;return;}void...
Q: How do I start creating a program to shuffle and deal a deck of cards? The program should consist o...
A: Program:Filename: Game.java package deckOfCards;import java.util.Scanner;public class Game {public s...
Q: Simplify the following expression in (1) sum of products and (2) products of sums: a) F = AC’ + B’D+...
A: Simplifying the expressionsThe notation in the Boolean algebra can be simplified by grouping or expa...
Q: A matrix named mach contains three columns of data concerning the energy output of several machines....
A: JAVA programClass name is Matrix. It contains function named Transfer.Create a matrix named mach of ...
Q: WHAT IS BLOCKCHAIN?
A: DefinitionBlockchain is a novel technology of today’s era. Blockchain is basically a growing list of...
Q: For the TCP/IP model, describe 2 types of vulnerabilities commonly attacked for each layer.
A: Two types of vulnerabilities in TCP/ IP model:TCP SYN flood attach (DDoS)DNS spoofing
Q: Write a Java program that prompts the user for the page size used in a virtual memory system; this w...
A: A Java program that accepts a valid system page size and virtual address and calculates the page num...
Q: I need help with Excel in my Intro to info systems. The thing i don't know how to do is this: It kee...
A: To solve this question user must know the definition of absolute reference:Absolute reference: An ab...
Q: what is the difference between authentication and authorization? Can a system permit autorization wi...
A: Authentication: ⦁ Authentication means the system is going to grant access to any individual by veri...
Q: Find the number of employees hired in January of all years
A: The select statement is used to select tuples (Raw) from the table.The cout(*) is used to count all ...
Q: Using the SQL GROUP BY phrase with a SELECT statement can help detect which of thefollowing problems...
A: This question is based on SQL language . To know the right option of this question first a user must...
Q: Create a new file (in Dev C++) and save it as lab10_XYZ.cpp (replace XYZ with your initials). In La...
A: C++ programThe code for calculator programs is#include <iostream>using namespace std;void disp...
Q: Programming Problem 1Write a program that has the user input their height in inches and convert it t...
A: Program Algorithm-STARTStep1: Import the essential packagesStep2: Define a class ConvertStep3: Decla...
Q: First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ...
A: Program InstructionsFirst, click on the file and create a new project called “PatternMaker”.Then, cr...
Q: Write a c++ program! In this assignment, you need to complete tasks on 2D array of randomly sales fi...
A: Following is the c++ program:Main function is used to execute a nested loop that inserts random valu...
Q: What trade-offs are involved in building highly distributed data environments?
A: Trade-offs that are involved in building highly distributed data environments: 1) Availability, 2) ...
Q: Excel Project How do create a formula to calculate daily totals in dollars. Multipy the value in the...
A: Excel is a software program developed by Microsoft. Excel has an electronic spreadsheet to organize ...
Q: construct a pda that accepts the language defined by the grammar s → abSb|λ.
A: Constructing PDA:There are two states q and f. q is the start state and f is the final state. Here i...
Q: Brief paragraph needed: We know that the Pep/9 simulated hardware has 64K of memory. But, how is tha...
A: Pep/9 hardwareThe pep/9 hardware consists of three components that is disk, central processing unit ...
Q: Let's say we have the attached table : 3. Find the years that company hired more than 5 employees
A: NOTE: - THE NEW SCHEMA IS ASSUMED WITH FOURTEEN RECORDS AS IT WAS NOT PROVIDED.SELECT is used to dis...
Q: Preffered language is java. Will be compiled with intellij. Need a solution for each part 1-5. Is it...
A: This program asks the user a question and tells whether the answer is correct or not. Keeps asking t...
Q: Write Python programs to solve the problem. Shipping is free for online orders totaling $50 or more ...
A: Python program that prompts for the unit price of an item and its quantity#get the inputs from the u...
Q: Write a function PrintShampooInstructions(), with int parameter numCycles, and void return type. If ...
A: Completing the given C++ program so, that it can follow the given rubrics:Firstly, displaying a mess...
Q: Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's repre...
A: A c++ program to find the binary equivalent of a number.Ask the user to enter an integer number. if ...
Q: 4.7: Time Machine Your time machine is capable of going forward in time up to 24 hours. The machine ...
A: Following is the c++ program that takes start time and future time as input from user and finally pr...
Q: d. Explain the steps of the fetch-decode-execute cycle. Your explanation should include what is happ...
A: A program consists of collections of instructions encoded using the method of binary numbers. The fe...
Q: Discuss the approaches used to categorize access control methodologies. Discuss the types of control...
A: Answer:Access control:Access control is a security technique that controls the admission of workers ...
Q: in c++m given the following, use a range-based for loop to display the contents of the array (use co...
A: Program code:
Q: Write a query to display the book number, title, and cost for all books in the “Database” subject so...
A: The name of the table is the subject.Attributes of the table are book_number, book_title, book_costC...
Q: Question 3
A: Writing the program code in java as in the given question no programming language is specified.This ...
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- How to make it the number a row? Can someone fix the code given below: import java.util.Scanner; public class Locker { static Scanner Balderas = new Scanner(System.in);public static void main(String args[]){System.out.print("Enter the number of lockers: ");int number = Balderas.nextInt();System.out.println("The Number of lockers and students are : " + number);int numberOfDivisors;for(int i=1; i <= number; i++){numberOfDivisors = 0;for(int j=1; j <= number; j++)if((i % j)==0)numberOfDivisors++;if (( numberOfDivisors % 2)!=0 )System.out.println("The Locker numbers left open at the end of the game are:"+ i);} } }8.What is the output of the following program? class A { protected: int a,b; public: void disp() { cout<<a<<b; } }; class B:public A { int x,y; }; i Garbage value ii Compile time error iii Runtime error iv Runs but gives random values as outputhi, why my code when i try to calculate BMI every time the answer equal 0.0 and can't get the right answer? package a;import java.util.*;public class a { public static void main(String []args){Scanner sc=new Scanner(System.in);label:System.out.println("Enter the number of cities");int noOfcities,nPerson;noOfcities=sc.nextInt();int under=0,obese=0,normal=0,over=0,c_under=0,c_obese=0,c_normal=0,c_over=0;double p_under,p_over,p_obese,p_normal;double max_normal=0.0,max_obese=0.0,min_under=100.0;String name,b_city="None",w_city="None",u_city="None",cat;int mass,height; while ( noOfcities<6){System.out.println("erro");System.out.println("Enter the number of cities"); noOfcities=sc.nextInt();}int i=0;while (i<noOfcities){i++;System.out.println("Enter the name of city");name=sc.next();System.out.println("Enter the number of persons");nPerson=sc.nextInt();while (nPerson<10){System.out.println("eror");System.out.println("Enter the number of…
- 4) Read the following second main class. Guess its output. class Test { public static void main(String s[]) throws Exception { TextThread x = new TextThread ("Hello"); TextThread y = new TextThread ("Java"); x.start(); x.join(); y.start(); System.out.println("I am Main thread"); } }Java Questions - Based on each code, which answer out of the choices "A, B, C, D, E" is correct. Each question has one correct answer. Thank you. Part 1 - 6. Given the following code, the output is __. class Apple { int x = 15; }class Banana extends Apple { int x = 25; }public class Sample {public static void main(String[] args) {Apple a1 = new Banana();System.out.println(a1.x);}} A. Compiler errorB. 25C. 15D. 0E. None of the options Part 2 - 7. Which is possibly a composite class? class Seed { ... }class Fruit { Seed s1 = new Seed(); }class Apple extends Fruits { ... }class Orange extends Apple { ... }class ApplePie { ApplePie a1 = new ApplePie(); } A. FruitB. AppleC. ApplePieD. OrangeE. Seed Part 3 - 10. Given the following code, which statement is true? class Water() { ... }class Juice() extends Water { ... }class Apple() { ... }class ApplePie() { Apple a1 = new Apple(); }class AppleJuice() { Apple a1 = new Apple(); Water w1 = newWater(); } A. Juice is a superclass and Water is a…Trace and document every step of execution of the following program: public class Trace { public static void main(String[] args) { int[] num = {1, 3, 6, 9, 12 }; for (int i = 4; i >= 0; i--) { num[i] +=1; } num[0] *=num[4]; } }
- Please sort out the following JAVA code....line by line. Run the code in Netbeans and provide screenshots to verify that it runs successfully. CODE: import java.io.*; import java.util.*; public class experiment { public static void main(String args[]) { Scanner in=new Scanner(System.in); int time[]=new int[10]; float weight[]=new float[10]; String get; char ch; int i=0; do{ try { System.out.print("\nEnter the time in seconds:"); time[i]=in.nextInt(); System.out.print("\nEnter the weight in kilograms:"); weight[i]=in.nextFloat(); i++; } catch(Exception e) { System.out.print("\nInvalid type"); } System.out.print("\n-----------------"); System.out.print("\n|Time\t|Weight\t|"); System.out.print("\n-----------------"); for(int x=0;x<i;x++) { System.out.print("\n|"+time[x]+"\t|"+weight[x]+"\t|"); System.out.print("\n-----------------"); } if(i==10) { for(int x=0;x<9;x++) { time[x]=time[x+1]; weight[x]=weight[x+1]; } i--; } System.out.print("\nDo you want to continue?(y/n) ");…Q3)What is the o/p of following program? public class MyClass { public static void main(String[] args) { int[] dest= new int[]{0, 1,2,3,4,5}; System.out.println(dest [0]+ dest [5]+dest [2]); } } Answers a) 052 b) Compilation Error c) 7 d)152Can this java code be cracked? If so how can I make so that it cannot be cracked? import java.io.*; public class Main { static int plnTxt[] = new int[26]; static char theVals[] = new char[]{'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}; static String theOtVal = "", theCipherTxt = ""; public static void main(String[] args) throws IOException { for (int i = 0; i < 26; i++) { plnTxt[i] = i; } InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); System.out.println("Enter Plaintext: "); theCipherTxt = br.readLine(); System.out.println("Enter key value: "); int k = Integer.parseInt(br.readLine()); for (int i = 0; i < theCipherTxt.length(); i++) { int j; if (theCipherTxt.charAt(i) == ' ') { i++;…
- can you help me complete the method huffmantoText and texttoHuffman public static void huffmanToText(){ //ToDo: convert text to huffman code } public static void textToHuffman(){ //ToDo: convert huffman code to its text equivalent }Instruction:Input a text that will be converted to Huffman code.- Output an error message if the text cannot be converted (e.g. using character/sin the input text that is/are not part of the table Huffman codes). Input a Huffman code that will be converted to its text equivalent.- Output an error message if the input cannot be converted.import java.util.Scanner; public class LabProgram { public static Roster getInput(){ /* Reads course title, creates a roster object with the input title. Note that */ /* the course title might have spaces as in "COP 3804" (i.e. use nextLine) */ /* reads input student information one by one, creates a student object */ /* with each input student and adds the student object to the roster object */ /* the input is formatted as in the sample input and is terminated with a "q" */ /* returns the created roster */ /* Type your code here */ } public static void main(String[] args) { Roster course = getInput(); course.display(); course.dislayScores(); }} public class Student { String id; int score; public Student(String id, int score) { /* Student Employee */ /* Type your code here */ } public String getID() { /* returns student's id */…What gets printed when the following program is compiled and run? class xyz { public static void main(String args[]) { int i,j,k; for (i = 0; i < 3; i++) { for(j=1; j < 4; j++) { for(k=2; k<5; k++) { if((i == j) && (j==k)) System.out.println(i); }}}}} a: 0 b: 1 c: 2 d: 3