What is the scope of the variable number? (Type your answer as two line numbers with a comma between. For example if a variable's scope would go from lines 5 to 10, you would type 5, 10.)
Q: The program is used to perform what, exactly?
A: Hardware and Software: The term "hardware" describes the actual, observable parts of the system,…
Q: Write 5 things you can do for scientific programming with your course of study ?
A: 1. Focus on developing you practical Computer Science skills What do you learn during Computer…
Q: Write a program to calculate the total final marks for a subject. There are four assessment types…
A: Here is the c program of above problem. See below steps for code.
Q: Write the difference between the java constructor and java method in table format. Please do as…
A: Given: Write the difference between the java constructor and the java method in table format.
Q: How do you know if your variable should be declared as an enum type or another data type? Give…
A: The solution to the given question is: When declaring a variable as enum type , you must use the…
Q: Write methods to find category of car and to display the complete details of car along with…
A: According to the fiven specification
Q: Make a list of all the different mathematical operations and then order them.
A: What is the order of operations? There are different Operations such as addition, subtraction,…
Q: Consider the following program. What does mooboo do? Provide an explanation with two example queries…
A: A A+B¯¯¯¯¯¯¯¯¯A+B¯ B AA C A.B¯¯¯¯¯¯¯A.B¯ D A+BA+B Answer B
Q: With a single statement, how can we declare the variable and initialize its fields? Let me give you…
A: Let us see the details below, Note: In the question programming language is not mentioned. So here I…
Q: Write a C Program that ask the user to choose from 2 categories, then ask the user to enter two…
A: C Code for computation of greatest or smallest number is in step 2.
Q: Slide 30 and Slide 34 of Lecture L2 show two different implementations of integer multiplication.…
A: Here we have given example solution for the mentioned numbers for multi[plication in binary form
Q: Write a program that converts feet to meters. Hint! Use relationship that 3.28 feet = 1 meter. %3D
A: PROGRAM CODE: #include<iostream>using namespace std;int main(){ double feet,mtr;…
Q: Assignment 2 Q1-Write a program in java to accept a grade and declare the equivalent description:…
A: Find Your Code Below
Q: write about height variable ?
A: The height variable in p5.js is a framework variable which stores the height of the drawing…
Q: Write a PHP program to print the datatypes of all the variables given below: i) "PHP" ii) 23 iii)…
A: Write a PHP program to print the datatypes of all the variables given below: i) "PHP" ii) 23 iii)…
Q: Is this solution using classes or pointers? or is it using struct data?? just want to make sure…
A: Here is the solution:
Q: match methods with their calls , use the line number as an indicator. int x-2, y-3, result%3; double…
A: int x=2, y=3, result1;double d1=3.4, d2=6.1, result2;boolean flag; public int function(int num1);…
Q: What is the value parameter? How is it created?
A: Value parameter: Passing parameter to a function using the value parameter is a way to pass a copy…
Q: Why did the more precise headers outperform the vaguer, more fascinating ones?
A: Intro The header is the most important portion of the article because it describes the content of…
Q: Which of the following is NOT true about emoticons?
A: Emoticons are a way to express human emotion while having an online chat. They come in different…
Q: A provable formula B is denoted by (you can write the answer in the paper and picture that answer…
A: Answer in step2
Q: Which keyword is used in order to supply a reference parameter, and what is the parameter's name?
A: The name of the parameter is preceded by a hyphen (-), which tells PowerShell that the word that…
Q: ava program for calculating addition, subtraction, multiplication use only switch case. I don't want…
A: Below the Java program for calculating addition, subtraction, multiplication use only switch case. I…
Q: What parameters should be sent to the range constructor, to produce a range with values 8, 6, 4, 2,…
A: The range() function returns a sequence of numbers. Syntax: range(start, stop, step) Parameter…
Q: String[] name={"John", "Mary", "Jim", "Sam"}; Which choice is correct? Group of answer choices…
A: String Datatype: The datatype is a set of values and each datatype have its own purpose. Based on…
Q: For each of the following parameter-passing methods, what are all of the values of the variables…
A: b)Passed by reference swap(value, list[0]); value = 1 ; list [5] = {2,3,5,7,9} swap(list[0],…
Q: How can we design a program using procedures? Give an example.
A: Procedure is a block of code which performs specific task Procedure offers reusability of the code…
Q: In computer memory, how do local declarations get put in place? Yes, but there aren't any good…
A: Local declarations in memory layout : Below is the basic memory layout of a program. The text area…
Q: Rewrite the below Java assignments in the correct version. char aChar = 5.5; i. if (salesAmount >10…
A: Please find the answer and a sample program below. Then the program contains the examples of all the…
Q: The SWORD type is used in what situations, exactly?
A: Purpose of SWORD type: SWORD is an intrinsic data type. Intrinsic data types and their operations…
Q: Which rule is used in the argument below? • Alice is a student in the class. . Alice got an A on the…
A: The given statements form the existential generalization rule which says if a statement holds for…
Q: What parameters should be sent to the range constructor, to produce a range with values 8, 6, 4, 2,…
A: The range() function returns a sequence of numbers. Syntax: range(start, stop, step) Default…
Q: Write a java program to give your own example of Relational operator.Give source code and output…
A: Here is the simple example of relational operator on JAVA Where I initialized a value of two…
Q: write a java program which create some sort of truth table to show a behaviour of all the logical…
A:
Q: Examine the code snippet below, and indicate what are the parameters? int result = Sum(5,6,7); ..…
A: Parameter: A parameter is a named variable passed into a function. Parameter variables are used to…
Q: write a program in php to find the mole fraction after taking number of moles of 2 solvent from…
A: I give the code in PHP with code and output screenshots.
Q: Given a variable x of type double. Which one is a valid statement to compute the half of x?
A: All of the above is the correct option a) x*=0.5 => This is multiply and assignment operator.…
Q: The simplification of the expression in the picture results in? Note that the expression negation()
A: Task :- Choose the correct option for given question. Given expression - (A.B' + A'.B)'.(A+B)
Q: QUESTION 6 Analyze these lines of code: public static int sum (int num1, int num2, int num3) answer…
A: c) num1, num2, num3
Q: What will happen if the onTouch() callback returns false instead of true?(Please type the answer)
A:
Q: Which of the following statements will NOT compile? Consider each statement independent of the…
A: The given code is related to java programming where inheritance concept is used and creation of…
Q: I am having trouble with doing this code on Python: Develop the Car class by creating an attribute…
A: Program code: #class definitionclass Car: #initializing values def __init__(self):…
Q: What parameters should be sent to the range constructor, to produce a range with values 50, 60, 70,…
A: CODE;- lst = [n for n in range(50, 81, 10)]print(lst)
Q: Write an assignment statement that will store the result of multiplying two variables, price and…
A: The assignment statement is written by using assignment operator. The assignment operator is as…
What is the scope of the variable number? (Type your answer as two line numbers with a comma between. For example if a variable's scope would go from lines 5 to 10, you would type 5, 10.)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- 12345678901 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 symbolimport java.util.Scanner; public class MealEstablishmentDirectory { public static void main (String[] args) { Scanner scnr = new Scanner(System.in); int newRating; String newState; MealEstablishment mealEstablishment1 = new MealEstablishment(); System.out.println("Default values: "); mealEstablishment1.print(); newRating = scnr.nextInt(); newState = scnr.next(); mealEstablishment1.setRating(newRating); mealEstablishment1.setState(newState); System.out.println("After mutator methods: "); mealEstablishment1.print(); } }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. End
- 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();}}} (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// DebugFive2.java // Decides if two numbers are evenly divisible import java.util.Scanner; public class DebugFive2 { publicstaticvoidmain(Stringargs[]) { int num; int num2; Scanner input =newScanner(System.in); System.out.print("Enter a number "); num = input.nextInteger() System.out.print("Enter another number "); num2 = inputnextInt(); if((num % num2 ==0) && (num2 % num) ==0) System.out.println("One of these numbers is evenly divisible into the other"); else System.out.println("Neither of these numbers is evenly divisible into the other"); } }// 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.
- 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);…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.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 - //…import 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…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 */ }}