Write code that outputs variable numDays. End with a newline.
Q: = (a*y)*x*
A: Given as, x+y*=x*y*x*
Q: ovided data.
A: The graphical user (connecting point/way of interacting with something), developed in the late 1970s...
Q: public class MyClass { public static void main (String args []) { int x = 1; System.out.println(x) ;...
A: here I written given code with fully understand language with comments that how all value will assig...
Q: Define/Explain the topic fully and identify the role that particular term, concept, or analysis play...
A: As per company guidelines we are suppose to answer only first 3 subparts of the question. Kindly re-...
Q: If a sequential program takes two hours to execute and 1500 cores are available to use, what is the ...
A: I have answer this question in step 2.
Q: To allows us to use the cout to generate output and the (manipulator) endl ,use
A: Solution:The input and output steam can be done with the help of #include<iosteam.h> header
Q: Which of the following best describe the idea of limited direct execution? It is the virtual a...
A: A central processing unit is also called a main processor or just processor is the electronic circui...
Q: Assume there is a rooted tree A. Write a recursive program that returns both the number of nodes(N) ...
A: The idea is to traverse the tree in postorder. If the current node is full, we increment result by 1...
Q: Help me write a project proposal esssay on Thrift store based on clothing which a profitable busines...
A: The thrift store business focuses on re-selling items such as clothing, household goods, and furnitu...
Q: Please implement in Haskell. The function should return a list of lists that is infinite. It should ...
A: First, I want to explain about Haskell after that I will write the code: Haskell is a completely fun...
Q: Find minimum POS for the following Maxterm expansion. Use K-Map. F(a, b, c, d) = TTM(0, 1, 2, 3, 4, ...
A: To find minimum POS using K-Map
Q: > c) -> a -> c type4 :: (a -> b -> c) -> a -> (d -> b) -> d -> c type5 :: (a -> b -> c) -> (d -> a...
A: For Factorial long factorial(int n) { if (n == 0) return 1; else return(n * factori...
Q: Computer 1 (C1), with a clock rate of 3 GHz, runs a program in 40 seconds. Computer 2 (C2), with a c...
A: Please refer below for your reference:
Q: A star configuration of a network represents its structure as a graph with an edge from a single, ce...
A: Here, I have to provide a solution to the above question.
Q: A body falls from rest in the gravitational field of the earth. The distance travelled in the fifth ...
A: Hi Dear!! Please give positive feedback!! As per the Bartleby guidelines I am giving a solution for ...
Q: In the two-phase commit protocol, describe what happens if a subordi- (a) nate receives a PREPARE me...
A: Two Phase Commit it is a atomic commitment protocol. Two Phase Commit is either all commit or all ab...
Q: How many bits does the alternating bit protocol require?
A: Introduction: The alternating bit protocol necessitates the use of a single bit. The alternating tec...
Q: What are the drawbacks of using session?
A: Session: Session is just the way to save the information of a website in a server itself so that can...
Q: Task - Solve the above problem using a linked list based stack.
A: Here our task is to solve the above problem using a linked list based stack. (In python)
Q: A compound Boolean expression containing the or operator is true only when one of its subexpressions...
A: Intro A compound Boolean expression containing the or operator is true only when one of its subexpr...
Q: Write a program to maintain the library including: i. Add new books ii. Search the library by book n...
A: package library; import java.util.*;import java.util.ArrayList;import java.util.InputMismatchExcepti...
Q: Why is virtualization the greatest option for running several operating systems on a single machine?
A: Introduction: To explain the virtual environment.A virtual machine (VM) represents a real computer i...
Q: In terms of media, what distinguishes an infrared network?
A: An infrared network:-
Q: 3: Book class In this exercise, you will create a class Book with the following attributes: Title, A...
A:
Q: List 3: Denial-of-service (DoS) attacks Distributed DDoS attacks Reflection attacks
A: As per company guidelines we are suppose to answer only first 3 subparts of the question. Kindly re-...
Q: QUESTION 2: According to the activity relation chart; a. Develop a block plan using the algorithm yo...
A:
Q: 8. Booth's Algorithm can multiply---- Two positive numbers Two negative numbers One positive and one...
A: We need to find the correct option.
Q: Briefly explain LOS and its 6 categories.
A: explain LOS Ans:- LOS stand for level for services .The notion of a traffic facility's Level-of-Ser...
Q: What's the difference between a hashtable and a hashmap?
A: The difference between a hashtable and a hashmap: 1) hashmap allows one null key along with multiple...
Q: In JDBC, what is the difference between CLOB and BLOB data types?
A: The full form of CLOB is Character Large Object. The full form of BLOB is Binary Large Object.
Q: Define the term HSRP?
A: Introduction: The Hot Standby Router Technology (HSRP) is a CISCO proprietary protocol that offers l...
Q: What is information organization
A: Information organisation and retrieval are part of the core functions of information professionals. ...
Q: Consider a system with 20 requests and out of 20 , 4 requests are already in cache memory. What will...
A: Introduction Consider a system with 20 requests and out of 20 , 4 requests are already in cache mem...
Q: What is database security, and how does it differ from other types of security? What are two ways to...
A: Database Security: Database security as same suggest helps in securing the database by using several...
Q: g) Write a Python program to input the elements of a list of size 10 and check if all the elements o...
A: Write a Python program to input the elements of a list of size 10 and check if all the elements of t...
Q: What are the software engineering applications of trustworthy software development?
A: Introduction: To work, many systems rely on software. With the digitalization movement that includes...
Q: Examine how the debugging process aided in the development of more secure, resilient apps. In additi...
A: Introduction debugging is the process to detect and remove the existing potential errors that are pr...
Q: Computer Science Hello, I have a question regarding R studio. How can I write a function named x tha...
A: Introduction Hello, I have a question regarding R studio.How can I write a function named x that cal...
Q: What is the memory space and computer time overhead associated with the execution of a recursive fun...
A: Introduction the question is about What is the memory space and computer time overhead associated wi...
Q: H.W (2) Consider the following clauses: C1. Noor likes all kinds of food. C2. Mango and chapati are ...
A: Introduction: First-order logic: First-order logic (like natural language) assumes the world contain...
Q: Explain the words undervoltage and overvoltage and how they might harm a computer or data.
A: Explain the words undervoltage and overvoltage and how they might harm a computer or data.
Q: In Javascript, Create a mouseOver event function, that will change the colour of an HTML item (i.e. ...
A: In this question we are asked to create a button or list and on hovering till 5 seconds color should...
Q: write a subroutine (in assembly) for ARMcortex-A9 that 1. accepts a memory address A passed in regi...
A: I have answer this question in step 2.
Q: What are the drawbacks of using OOPS?What are the drawbacks of using OOPS?
A: Introduction: Object-oriented programming (OOP) is a programming methodology characterised by the id...
Q: Give a formal derivation in modal logic K showing that KE O (p^ q) → O(p V q). You can use either ba...
A: Modal logic K is given as (p ∧ q) → (p ∨ q). It is always true statement because in order to make it...
Q: What are the events that occur when a CPU delivers a command to the SCSI controller?
A: Introduction: A SCSI controller, also known as a host bus adapter (HBA), is a card or chip that allo...
Q: You are given a hash map implementation that can store key-value pairs with the following operations...
A: I have answer this question in step 2.
Q: 2. This involves a .txt file with one thousand rows of random numbers (between 1-1000) Using Py...
A: 1. File Input/OutputFile Input/Ouput (IO) requires 3 steps: Open the file for read or write or both...
Q: Explain in detail what Big Data is and what IoT is.
A: Big Data Data is defined as facts and statistics that may be utilized to obtain knowledge, make dec...
Q: //This method is passed in 2 Strings and returns the longer public static String longerString(String...
A: For this function, we will be using a simple if control structure with length() for calculating the ...
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- This isn't not working for me. import java.util.Scanner; public class LabProgram { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int userNum = in.nextInt(); int divNum = in.nextInt(); System.out.print("What is the user number?"); userNum = scnr.nextInt(); int a, b, c; a = userNum/divNum; System.out.println(a); b = a/divNum; System.out.println(b); c = b/divNum; System.out.println(c); }} ERROR LabProgram.java:6: error: cannot find symbol int userNum = in.nextInt(); ^ symbol: variable in location: class LabProgram LabProgram.java:7: error: cannot find symbol int divNum = in.nextInt(); ^ symbol: variable in location: class LabProgram 2 errorsPlease determine errors and correct it. package test; import java.util.Scanner; public class Test { public static void main(String[] args) {String fname,lname; int hrsworked; Double payrate,income,fnfp,paye,fiji,medical=6.50,total_deduction,netpay; Scanner sc = new Scanner(System.in); System.out.print("\nEnter Employee First Name: "); fname = sc.nextLine(); System.out.print("Enter Employee Last Name: "); lname = sc.nextLine(); System.out.println("Enter Employee Hours Worked: "); hrsworked = sc.nextInt(); System.out.print("Enter Employee Pay Rate: "); payrate = sc.nextDouble(); income = hrsworked * payrate; fnfp = income*0.085; paye = income*0.065; fiji = income*0.0285; total_deduction = hrsworked + fnfp + paye + fiji +medical; netpay = income-total_deduction; System.out.printf("\n*-------------* Pay Slip for: %s *-------------*\n",(fname+" "+lname)); System.out.printf("Fortnightly Income: $ %.2f\n",income); System.out.printf("Hours Worked: \n", hrsworked); System.out.printf("FNPF: $…public class ReversedDigit { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("Please enter a number: "); int number = scan.nextInt(); int reversedNumber = 0; do { reversedNumber = number%10; number = number/10; } while (number > 0); }} Modify the coding example, to count what is the total of all digits of a number. For example, when user enters 301, your output is 4 because 3+0+1=4; when user enters 5116, your output is 13 (5+1+1+6 = 13).
- import java.util.*;public class TestAverage {public static void main(String[] args) {int test1, test2, test3, sum;Scanner reader = new Scanner(System.in);System.out.println("Enter test 1");test1 = reader.nextInt();System.out.println("Enter test 2");test2 = reader.nextInt();System.out.println("Enter test 3");test3 = reader.nextInt();sum = test1 + test2 + test3;System.out.println("The sum is " + sum);System.out.println("The average is " + sum / 3);}}a. Briefly explain what this code does.b. There is one logic error in this code explain what is wrong and how to fix it.public class TwoColors 10 { public static void main(String[] args) { Scanner in = new Scanner(System.in); 11 12 13 14 System.out.print("Enter your first favorite color: "); 15 16 // Step 2: Read in the next line of input and assign • it to a String variable color1 17 // 18 19 // Step 3: Trim spaces from both end and convert the // // 20 input to all lowercase and assign it back 21 22 to the same variable 23 24 System.out.print("Enter your second favorite color: "); 25 26 // Step 4: Read in the next line of input and assign 27 // it to a String variable color2 28 29 30 // Step 5: Trim spaces from both end and convert the // // 31 input to all lowercase and assign it back 32 33 to the same variable 34 35 // Step 6: Display a message according to the following: // 36 first color 37 second color message light blue 38 red That's wonderful! light blue 39 red That's even better! That's also great! 40 otherwise 41 4212345678901 2 public class BMICalculation { 3- Y 10 import java.util.Scanner; 11 12 13 } public static void main(String args[]) { Scanner in = new Scanner(System.in); System.out.print("Enter your weight in pounds") in.nextInt (); System.out.print("Enter your height in inches") in.nextDouble(); double feet BMI bmi new BMI (weight, feet); System.out.println("BMI: } int weight w +bmi.getBMI()); System.out.println(bmi.getStatus()); line 9 i got two errors saying cannot find symbol
- Examine this code and determine what happens when it is run: 1 public class Test { int x; 2 3 public Test(String t){ System.out.println("Test"); } public static void main(String[] args) { Test test = new Test ("boo"); System.out.println(test.x); } 4 5 6 7 8 10 } The program has a compile error because Test does not have a default constructor. The program has a compile error because System.out.println method cannot be invoked from the constructor. ) The program runs successfully and prints out: Test O The program has a compile error because you cannot create an object from the class that defines the object.StringFun.java import java.util.Scanner; // Needed for the Scanner class 2 3 /** Add a class comment and @tags 4 5 */ 6 7 public class StringFun { /** * @param args not used 8 9 10 11 12 public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Please enter your first name: "); 13 14 15 16 17 18 System.out.print("Please enter your last name: "); 19 20 21 //Output the welcome message with name 22 23 24 //Output the length of the name 25 26 27 //Output the username 28 29 30 //Output the initials 31 32 33 //Find and output the first name with switched characters 34 //All Done! } } 35 36 37import java.util.Scanner; public class leapYearLab { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int userYear; boolean LeapYear; System.out.println("Enter the year"); userYear = scnr.nextInt(); isLeapYear(userYear); //if leap year if (isLeapYear){ System.out.println(userYear + " - leap year"); } else{ System.out.println(userYear + " - not a leap year"); } scnr.close(); } public static boolean isLeapYear(int userYear){ boolean LeapYear; /* Type your code here. */ if ( userYear % 4 == 0) { // checking if year is divisible by 100 if ( userYear % 100 == 0) { // checking if year is divisible by 400 // then it is a leap year if ( userYear % 400 == 0) LeapYear = true; else LeapYear = false; } // if the year is not divisible by 100 else…
- Java - How do I output this statement as a horizontal statement with a newline? Everytime I use System.out.println, it makes the entire output vertical instead of horizontal. Program below. import java.util.Scanner; public class LabProgram { public static void main(String[] args) { int x; int y; Scanner scan = new Scanner(System.in); x = scan.nextInt(); y = scan.nextInt(); if(y >= x){ for(int i=x; i<=y; i = i + 5) { System.out.print(i+ " "); (The problem line) } } else{ System.out.print("Second integer can't be less than the first."); } }}Write the flowchart of this code import java.io.*;import java.util.Scanner;public class StudentGrades {public static void main(String args[]) {Scanner sc = new Scanner(System.in);System.out.println("Enter Quiz grade for 30:");float quiz = sc.nextInt();System.out.println("Enter Requirement grade for 20:");float requirement = sc.nextInt();System.out.println("Enter major exam grade for 50:");float major = sc.nextInt();float average = ((quiz + requirement + major)/100 ) * 100;System.out.println("The Average Grade: "+average);char grade; if(average>=80){grade = 'A';}else if(average>=60 && average<80){grade = 'B';}else if(average>=40 && average<60){grade = 'C';}else {grade = 'D';} System.out.println("The Rating is: " + grade);}}Write a statement that outputs variable userAge. End with a newline. Program will be tested with different input values. import java.util.Scanner; public class VariableOutput {public static void main (String [] args) {int userAge; Scanner scnr = new Scanner(System.in);userAge = scnr.nextInt(); // Program will be tested with values: 15, 40.