Type the program's output import java.util.Scanner; public class BreakAndContinue { public static void main (String 0 args){ Scanner scnr = new Scanner (System.in); int result; int a; Input int b; int c: 22 a = scnr.nextInt (); scnr.nextInt (); c = scnr.nextInt 0; 28 result = 0; Output while (a < b) { result 2; System.out.println(result); if (result > c) { break; a += 3;
Q: Is it possible to predict what effect Bluetooth devices linked to mobile units will have on the pico...
A: A piconet is an ad hoc network that uses Bluetooth technology protocols to connect a wireless user g...
Q: Wireless networks are less efficient than conventional networks.
A: Introduction: Wireless networks and Wired networks 1) A network is a collection of two or more syst...
Q: Express the following decimal numbers as 5211 code numbers. 31. 36 33. 45.26 32. 297 34. 106.31 Expr...
A: Here, we are going to convert decimal numbers into 5211 code numbers and also few numbers convert fr...
Q: What is the reason that DMA requires cycle stealing?
A: We need to discuss, why DMA requires cycle stealing?
Q: What are the other two most significant roles of an operating system, besides process management, do...
A: Let's also know Operating System: An operating system (OS) is system software that manages computer...
Q: A layer may fulfill five different functions. How many layers would be needed for one or more of the...
A: Introduction: A layer's responsibilities A layer's five primary responsibilities are as follows: It ...
Q: The difference between writing a comment in an m-file and writing a comment in a mdl file is explain...
A: An m-file, often known as a script file, is a text file that contains MATLAB commands. When you run...
Q: How did early operating systems differ from the goals of today's operating systems in terms of their...
A: How did early operating systems differ from the goals of today's operating systems in terms of their...
Q: Translate the function insert() below to RISC-V by hand.
A: Translate the function insert() below to RISC-V by hand.
Q: This Extended Event Session is created by default for every instance of SQL Server. O page_splits O ...
A: According to the information given:- We are suppose to choose the correct option to satisfy the sta...
Q: Why is it necessary for the maximum packet lifetime to be large enough to ensure that not only the p...
A: Introduction: TCP - Transmission Control Protocol is a network protocol that connects two hosts and ...
Q: doubling the digits starting from the next-to-last one, yields 18 18 10 8. Adding all digits in thes...
A: CODE WITH COMMENTS #include <iostream>using namespace std; int main(){ int n;char ch;// welcom...
Q: Using C and implementing MPI how would you find the global sum and make sure their all the same in C...
A: In this question, we are asked to write a C program which shows the behavior of global variable and ...
Q: Explain how to decide to wither use Throw or throws keywords. Differentiate between Checked exceptio...
A: Below find the solution 1 Both throw and throws are concepts of exception handling in Java. The thro...
Q: Give an example of a UML timing diagram.
A: Timing diagrams are part of Interaction diagrams in UML, which do not use the same notations as sequ...
Q: Discuss how interrupts might increase the machine's efficiency and minimise idle times.
A: Intro Interrupt alerts the processor to high-priority Processes requiring interruption of the curren...
Q: Explain and differentiate the SHA, RSA, and AES algorithms. Is there a role for hashing in the field...
A: Introduction: When a person signs in, you SHA the password they provide you, compare them, and make ...
Q: What may be the commonalities between the meanings of Feeling and Agreeableness? Do your scores on F...
A: According to the Bartelby guideline we are suppose to answer only one question at a time Kindly repo...
Q: Additional Problem: Write a program that produces the batting averages of the three baseball players...
A: I give the code along with output and code screenshot
Q: Using R, I need to create a code that checks whether a number x is a prime number or not using RECUR...
A: Ok i will do with my own code
Q: What examples of each SOA principle in service implementation did you find? Standarized service cont...
A: explain SOA principle in service implementation standarized service contract loose coupling service ...
Q: Simplify the following Boolean expressions using three variable k maps
A: K map is used to solve Boolean expression graphically.
Q: Define the number of CPU clock cycles.
A: The number of CPU clock cycles is the number of clock cycles the CPU needs to execute a single instr...
Q: How many patients in the database have been diagnosed with acute bronchitis (ICD9Code = 466) and hav...
A: Intro the question is about How many patients in the database have been diagnosed with acute bronchi...
Q: iv) Write a Python program to input two integers t1, t2 from the user and then find the value of the...
A: Code : Output :
Q: MAKE A CIRCUIT ABOUT RELAY TO DRIVE SOLENOID VALVE USING TINKERCAD.
A: INTRODUCTION: We make the circuit in TINKERCAD.
Q: Define the concept of temporal locality.
A: Locality: Programs frequently employ data and instructions with similar or identical addresses to th...
Q: 2. A friend needs to drive from City X to City l and would like to find the shortest route between t...
A: Here, I have to find the minimum distance from city X to city I.
Q: When measuring angles values less than 0 or greater than 360 can be converted into the range [0,360]...
A: Code: x <- c(45,345,600,23,705)k<-0for (value in x) {k<-k+1 if(value>360){ while(v...
Q: Write a JAVA program to find the topological order of nodes of a graph using DFS. NB : I Need The pr...
A: Hi Please Upvote to my hardwork!!! // A Java program to print topologicalimport java.util.*; // Cl...
Q: What is database management and how does it work
A: In Step 2, I have provided brief explanation about database management system ------------
Q: Assume that name and age have been declared suitably for storing names (like "Abdullah", "Alexandra"...
A: Given :- Assume that name and age have been declared suitably for storing names (like "Abdullah", "A...
Q: Prove that the function y = n* + 3 can't belong or does not belong to the set of 0(1) using Big-0 No...
A: - We need to prove that the function y = n4 + 3 does not belong to the set of O(1).
Q: Where does cloud computing fit best in terms of organisational structure and operations?
A: Intro the question is about Where does cloud computing fit best in terms of organisational structure...
Q: Concept of SD-WAN?
A: Describe Concept of SD-WAN.
Q: A trigger's execution might result in the execution of another action. The depth of nesting in most ...
A: Trigger: When a database's relations are adjusted, triggers are used to specify the impact of the al...
Q: Please edit my code thankyou to the given picture #include int main() { char ch; double firstN...
A: used switch statement for this coding also used do while loop for the repetition of switch statement...
Q: In Windows 7, how does the user threads transfer to the kernel thread? Is it a one-on-one model, a m...
A: Introduction: So, with Win 7, a user needs first to understand thread, thread types, and thread mode...
Q: Contrast the iOS and Android smartphone operating systems. Which is superior?
A: Intro The question is about Contrast the iOS and Android smartphone operating systems. Which is supe...
Q: Explain how QUIC avoids a couple of round-trip times (RTTs) that are typically required at the begin...
A: Introduction: QUIC is a novel multiplexed and secure transport protocol built on top of UDP. QUIC re...
Q: What malware traits differentiate a virus programme?
A: Introduction: A malware program is software that is used to obtain access to a victim's computer sys...
Q: Unmask is a term that I'm not familiar with
A: Introduction: Unmask is a term that I'm not familiar with Umask, or user file-creation mode is a Li...
Q: What are the responsibilities of a project sponsor during the various SDLC phases
A: Who is a Project Sponsor?In terms of stakeholder management, a project sponsor is a person(s) or an ...
Q: What influence does data mining have on personal privacy and security?
A: Introduction: Data extraction from data sets can be accomplished using privacy-protected data mining...
Q: An acronym is a word formed by taking the first letters of the words phrase and making a word from t...
A: Answer :
Q: Describe the two opposing viewpoints on the construction of the kernel of an operating system
A: Given The answer is given below
Q: Briefly describe how you can use asymmetric key encryption to ensure the confidentiality of outgoing...
A: Let's understand how asymmetric encryption working with reference to symmetric encryption also: Symm...
Q: PYTHON list=[((0, 2), 5), ((0, 3), 3), ((0, 5), 4), ((0, 6), 8), ((0, 8), 2), ((1, 0), 8)] How can...
A: Python code for above : for item in list: print(item[0], end = " ")
Q: What are the benefits and drawbacks of using a hosted software solution to "test drive" a potential ...
A: benefits: the reduced total cost of ownership, lower risk of implementation, device maintenance out...
Q: Write a program to convert length in miles, yards, feet and inches to a Metric System length in kilo...
A: Python: Functions are subprograms that compute a value or perform a task. Functions decrease the num...
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- import java.util.Scanner; public class PetInformation {public static void main(String[] args) {Scanner scnr = new Scanner(System.in); Pet myPet = new Pet(); Cat myCat = new Cat(); String petName, catName, catBreed; int petAge, catAge; petName = scnr.nextLine(); petAge = scnr.nextInt(); scnr.nextLine(); catName = scnr.nextLine(); catAge = scnr.nextInt(); scnr.nextLine(); catBreed = scnr.nextLine(); // Create generic pet (using petName, petAge) and then call printInfo myPet.setName(petName); myPet.setAge(petAge); myPet.printInfo(); // Create cat pet (using catName, catAge, catBreed) and then call printInfo myCat.setName(catName); myCat.setAge(catAge); myCat.setBreed(catBreed); myCat.printInfo(); // Use getBreed(), to output the breed of the cat System.out.println(" Breed: " + myCat.getBreed());}}import java.util.Scanner; public class WinningTeam { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); Team team = new Team(); String name = scnr.next(); int wins = scnr.nextInt(); int losses = scnr.nextInt(); team.setName(name); team.setWins(wins); team.setLosses(losses); team.printStanding(); }}import java.util.Scanner; public class WinningTeam { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); Team team = new Team(); String name = scnr.next(); int wins = scnr.nextInt(); int losses = scnr.nextInt(); team.setName(name); team.setWins(wins); team.setLosses(losses); team.printStanding(); }} This is the second part of the program and not geting it to run public class Team { // TODO: Declare private fields - name, wins, losses private String name; private int wins; private int losses; public int getlosses(){ return losses; } // TODO: Define mutator methods - // setName(), setWins(), setLosses() public String setName(){//String name int wins int losses return name; } public int setWins(){ return wins; } public int setLosses(){ return losses; } // TODO: Define accessor methods - //…
- Fix this program import java.util.Scanner; public class main { public static void WeShipItBad(String[] args) { int OVERNIGHT_CHARGE = 5; int TWO_DAY_CHARGE = 2; int ECONOMY_CHARGE = 1; Scanner console = new Scanner(System.in); // Scanner object to pass around. // Get item description. String itemDescription = getItemDescription(console); if (itemDescription.equals("")) { System.out.println("Invalid description."); } shipWeight = getShipWeight(scnr); if (shipWeight <= 0.0) { System.out.println(); System.out.println("Invalid weight."); } char shipMethod = getShipMethod(council); shipMethod = Character.toUpperCase(shipMethod); double shipCost = calculateShip(shipWeight, shipMethod); displayResults(itemDescription, shipCost, shipMethod, shipWeight); } public static void getItemDescription(Scanner console) { System.out.println("Enter item description:"); String description =…import java.util.Scanner; public class CharMatch { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); String userString; char charToFind; int strIndex; userString = scnr.nextLine(); charToFind = scnr.next().charAt(0); strIndex = scnr.nextInt(); /* Your code goes here */ }}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);}}There is one logic error in this code explain what is wrong and how to fix it.
- 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).Code example 2-1import java.util.Scanner;public class InvoiceApp {public static void main(String[] args) {Scanner sc = new Scanner(System.in);String choice = “y”;While (choice.equals(“y”)) {System.out.print("Enter subtotal: ");double subtotal = sc.nextDouble();double salesTax = subtotal * .0875;double invoiceTotal = subtotal + salesTax;String message = “Subtotal = ” + subtotal + “\n”+ “ Sales tax = ” + salesTax + “\n”+ “Invoice total = ” + invoiceTotal + “\n\n”System.out.println(message);System.out.print(“Continue? Enter y or n: ”);Choice = sc.next();}}}38. (Refer to code example 2-1.) If the user enters “Y” when asked if he/she wants to continue, the application will a. repeat the while loop b. display a blank line, then repeat the while loop c. EndCode example 2-1import java.util.Scanner;public class InvoiceApp {public static void main(String[] args) {Scanner sc = new Scanner(System.in);String choice = “y”;While (choice.equals(“y”)) {System.out.print("Enter subtotal: ");double subtotal = sc.nextDouble();double salesTax = subtotal * .0875;double invoiceTotal = subtotal + salesTax;String message = “Subtotal = ” + subtotal + “\n”+ “ Sales tax = ” + salesTax + “\n”+ “Invoice total = ” + invoiceTotal + “\n\n”System.out.println(message);System.out.print(“Continue? Enter y or n: ”);Choice = sc.next();}}} (Refer to code example 2-1.) If the user enters 100 the first time the while loop is executed, what will the program display at the console? a. Subtotal: 100.0 Sales tax: 8.75 Invoice total: 108.75 b. Subtotal = 100.0 Sales tax = 8.75 Invoice total = 108.75 c. Subtotal = 100.0 Sales tax = 8.75Invoice total = 108.75 d. Subtotal = 100.0 Sales tax = 8.75Invoice total = 108.75
- import java.util.Scanner; public class TicketCounter { public static void main (String [] args) { int awardPoints; int userTickets; Scanner scnr = new Scanner(System.in); userTickets = scnr.nextInt(); // Program will be tested with values: 5, 6, 7, 8. if (userTickets < 6) { awardPoints = 1; { else { awardPoints = userTickets; } System.out.println(awardPoints); }}import java.util.Scanner; public class InstrumentInformation { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); Instrument myInstrument = new Instrument(); StringInstrument myStringInstrument = new StringInstrument(); String instrumentName, manufacturerName, stringInstrumentName, stringManufacturer; int yearBuilt, cost, stringYearBuilt, stringCost, numStrings, numFrets; boolean bowed; instrumentName = scnr.nextLine(); manufacturerName = scnr.nextLine(); yearBuilt = scnr.nextInt(); scnr.nextLine(); cost = scnr.nextInt(); scnr.nextLine(); stringInstrumentName = scnr.nextLine(); stringManufacturer = scnr.nextLine(); stringYearBuilt = scnr.nextInt(); stringCost = scnr.nextInt(); numStrings = scnr.nextInt(); numFrets = scnr.nextInt(); bowed = scnr.nextBoolean(); myInstrument.setName(instrumentName); myInstrument.setManufacturer(manufacturerName);…// ArtShow.java - This program determines if an art show attendee gets a 5% discount // for preregistering. // Input: Interactive. // Output: A statement telling the user if they get a discount or no discount. import java.util.Scanner; public class ArtShow { public static void main(String args[]) { Scanner s = new Scanner(System.in); String registerString; System.out.println("Did you preregister? Enter Y or N: "); registerString = s.nextLine(); // Test input here. If Y, call discount(), else call noDiscount(). System.exit(0); } // End of main() method. // Write discount method here. // Write noDiscount method here. } // End of ArtShow class.