Put a box around your answers for the outputs. Determine the output for #1 - 5. 1. int i = 2; while (i < 10) System.out.printIn(i): 2. int i = 2; while (i < 15) i= i+ 2; System.out.printin(i): 3. int i = 5; for (int j = 1; j < 7; j++) ·
Q: Write a program that reads in a room number, the room's capacity, and the size of the class enrolled…
A: Find the code in python as language not mentioned given as below and output:
Q: Which value of x results in short circuit evaluation, causing y (x >= 7) && (y A. 6 B. 7…
A: In between first part (x >= 7) and second part (y < 4) there is a logical AND operator. So,…
Q: Java Program Please Write a program that will print a histogram of stars indicating the number of…
A: Declare array to store number of students who scored from 90 to 100 Based on the value, print the…
Q: Suppose a program has runtime proportional to nlogn, where n is the input size. If the program…
A: Let, runtime for input n be T(n) Given, T(n) ∝ nlog(n) Let the proportionality factor be k. We have,…
Q: Q5. In the program fragment below, which of the outputs is the best estimated value? int N =…
A:
Q: Java, write an algorithm to determine the conditional entropy of the following lists: S1 S2 [0, 0,…
A: Java programming language is an object-oriented programming language, that's used to develop…
Q: Demonstrate the output of the given program code. int a, t=0, x=1, y=2, z=3; for (a=1;a<4;a++) {…
A: answer is
Q: Design a project to calculate Xt, where Xt is to be calculated either Xt- xI, or Xt= X2, or…
A: The answer is TRUE
Q: Consider the code below. In Big-O notation, what is the order of it? Explain your answer. for…
A: The order of the code is below along with time complexity:
Q: Write a JAVA program that simulates a circuit for controlling a hallway light that has switches at…
A: The program written in java is given below class ThreeWaySwitch { private int…
Q: Write a program that would read 3 1-digit numbers say x,y, and z and would output the following:…
A: Dear Student, As programming language is not mentioned I am writing it in C.
Q: Write a program that is given two doubles for comparison and a third double that is a differen three…
A: C++ program:#include <iostream>#include <math.h>using namespace std; int main(){…
Q: o open the lamp: in the case of pressure according to a certain sequence (When person type the…
A: Using the buttons (number 2) to open the lamp: in the case of pressure according to a certain…
Q: Implement the following Boolean equations in a Structured Text program. If the program wa for a…
A: It is defined as an up and coming, popular programming language used in PLCs. This language is much…
Q: Write a program using switch which prints different letters depending on the value of an integer…
A: Note: since programming language is not mention we are providing solution c programming; please…
Q: A project currently underway at Chemical Labs, Inc requires that a substance be continued ally…
A: Answer python program import time def main():on_flag = True # set the thermostat flag True means…
Q: Write a program in Coral whose inputs are three integers, and whose output is the largest of the…
A: Write a program in Coral whose inputs are three integers, and whose output is the largest of the…
Q: for (int i = 0; i < 5; i++) Output: System.out.print((i + 1) + " "); Final value of i:
A: this is the output of your code:
Q: Write a JAVA program to generate two cards randomly and display the bigger card between them. The…
A: The question is to write the JAVA code for the given problem.
Q: Write a program that simulates flipping a coin to make decisions. The input is how many decisions…
A: The solution for he above given question is given below:
Q: The following program is designed to echo a message from one child process to another, with upper…
A: The issue is here: ORIGINAL PROGRAM GIVEN IN QUESTION #include<stdio.h>…
Q: Derive rules of thumb that apply when the new input size is the square root of the original input…
A: Please upvote. I am providing you the correct answer below.
Q: Where did I go wrong? And what to fix?Also please give me the solution with explanation. Show the…
A: Given: code Required: to find the issue in the code and correct it. explanation: there is no need…
Q: Write a Java Program below Get the value from a user? - Find the Area Of Circle - Find the Average…
A: Please find the answer below
Q: CHALLENGE ACTIVITY 5.8.1: Nested loops: Print rectangle Given the number of rows and the number of…
A: PROGRAM CODE: # Python Program to Print Rectangle Star Pattern# take number of rows from the…
Q: Modify each program given in this lab to include response time #include #include int…
A: Given question has asked to add response time to given program.
Q: Evaluate the given Computer Expressions below: Suppose the value of A = 10; B = 15; C = 20.50; D =…
A: INTRODUCTION: Here we need to tell the answer of the given computer expression. According to…
Q: S Consider the following code: module D (out, a, b, c), output out input a,b.c wire e, and #(5)…
A: you put out more than one question so won't be provided an explanation. question 5. answer: e=0…
Q: able 1.1: Number of Operations (Run Time Function vs Input Size) Input Size n = 10 n = 100 n = 1000…
A: Time complexity: It determine the CPU computation.,estimation of CPU computation required to…
Q: Write a program that calculates how much each salesperson earns when their gross pay and incentive…
A: Below I have provided Python Programming. Also, I have attached the screenshot of the code and…
Q: . Modify the following program so that it terminates, printing "Invalid input" as soon as an invalid…
A: PROGRAM EXPLANATION: - The Scanner object is created to take input from user. Two integer variables…
Q: Write a program that reads in a room number, the room's capacity, and the size of the class enrolled…
A: - We need to code the seat problem in C.
Q: Create a Java program that loops around getting two fractions from the user, output their sum, and…
A: PROGRAM EXPLANATION: - The Fraction is a Zero fraction if the numerator is 0 and the denominator is…
Q: 1. int day, int month, int year; boolean dayOK, monthOK, yearOK, rangesOK; 1. javautil Scanner…
A: The question has checks on date, month and year thus we need to test all possible scenarios.
Q: your program with data in Testing and with one more set of different d the 2 outputs. Include…
A: Code for the solution is given below
Q: Consider the very generous grading software: · If a student receives 30 points or lower on…
A: Required:
Q: Writ
A: Coded using Java.
Q: Write a MATLAB program to read the value of (), then: i. Check if x is integer and betwoen 0 and 10,…
A: 1) y = input("Enter a value"); if y/round(y)==1 && y>=0 && y<=10…
Q: ) for (int i = 0; i < 5; i++) Output: System.out.print((i + 1) + " "); Final value of i:
A: Output: 1 2 3 4 5 Final value of i: 6
Q: Consider the following three code segments. I. int i=1; while (i <= 10) { System.out.print(i); i+=2;…
A: Here is the detailed explanation of the solution
Q: Explain the expression in at least 2 sentences. Instead of a notation such as y = f (x),…
A: Instead of a notation such as y = f (x), could we use the same symbol for the output as for the…
Q: Write a Java program to print an American flag on the screen. Expected Output: * * *
A: Please find the answer below:
Q: Derive rules of thumb that apply when the new input size is the square root of the original input…
A: Please upvote. I am providing you the correct answer below.
Q: Write a Little Man program that accepts three values as input and produces the largest of the three…
A: PROGRAM CODE: INP // command to take the input STA M0…
Q: a program that simulates flipping a coin to make decisions. The input is how many decisions are…
A: heads_or_tails() input 1 TypeError: heads_or_tails() missing 1 required positional argument:…
Q: Write a program that reads in a room number, the room's capacity, and the size of the class enrolled…
A: I am compelled to solve only one question due to company policies. Please post the Flow Chart…
Q: Write a Java programme to calculate the number of 200, 100, 50, 20, 10, 5, and 1 TL banknotes in a…
A: Please see the next step for solution
Trending now
This is a popular solution!
Step by step
Solved in 4 steps
- In this assignment, you are going to complete a program that compute gross and net payment based on hourly wage, hours worked and a couple withholdings. Implementation Details: Make sure the outputs line up on the right-hand side. Each column in the output lines up vertically. ● The program prompt the user to enter the number of hours per week. The gross pay, net pay and the deduction is computed based on the total the number of hours worked. The deductions includes Federal tax, state tax, social security, medicare. Use declare named constants and initialize them to the values below: FEDERAL_TAX_PERCENT: 10.0 STATE_TAX_PERCENT: 3 SS_PERCENT: 6.2 MEDICARE PERCENT: 1.45 PAY_PER_HOUR: 11.25 Create a class called PayCalc to compute a person's gross and net weekly pay based on their hourly wage, hours worked, and several withholdings. All statements should be defined in the main method of the class (except for declarations of constants). ● Once your program is implemented, compile and run…Write the pseudocode for the following scenario: A manager at a 2nd hand car dealership wants to keep track of the amount (in Rands) of commission paid to the sales people. You must take the following into consideration: • There may be more than one salesperson (each salesperson has a unique employee code)– input the employee code. An employee code of zero (0) terminates the program. • The salesperson’s commission is based on their sales (in Rands) in the past month- input the sales for each salesperson. • Calculate the total car sales (in Rands). • Calculate a salesperson’s commission (in Rands). Commission is based on the following table: Total value of cars sold Percentage commission earned Less than or equal to R500 000 10% More than R500 000 15% • Calculate the total commission the manager must pay to all of the salespeople. • Display a report for the manager in the following format: Employee Code: 2 Sales: R400000 Commission: R40000 Employee Code: 4 Sales: R650000…In CORAL LANGUAGE please and thank you! Summary: Given integer values for red, green, and blue, subtract the gray from each value. Computers represent color by combining the sub-colors red, green, and blue (rgb). Each sub-color's value can range from 0 to 255. Thus (255, 0, 0) is bright red, (130, 0, 130) is a medium purple, (0, 0, 0) is black, (255, 255, 255) is white, and (40, 40, 40) is a dark gray. (130, 50, 130) is a faded purple, due to the (50, 50, 50) gray part. (In other words, equal amounts of red, green, blue yield gray). Given values for red, green, and blue, remove the gray part. Ex: If the input is: 130 50 130 the output is: 80 0 80 Hint: Find the smallest value, and then subtract it from all three values, thus removing the gray.
- In python, a) In the Hi-Lo game, the player begins with a score of 1000. The player is prompted for the number of points to risk and a second prompt asks the player to choose either High or Low. The player’s choice of either High or Low is compared to a random number between 1 and 13, inclusive. If the number is between 1 and 6 inclusive, then it is considered “low”. A number between 8 and 13 inclusive is “high”. The number 7 is neither high nor low, and the player loses the points at risk. If the player had guessed correctly, the points at risk are doubled and added to the total points. For a wrong choice, the player loses the points at risk. Create a HiLo application based on this specification. Application output should look similar to b) Modify the application to allow the player to continue until there are 0 points left. At the end of the game, display the number of guesses the user took before running out of points."You have been asked to create a guessing game with four players. The players will be asked to guess which word will be selected next and earn points for each correct guess." The game works as follows: First: At the start of the game: Each of the four players is asked to enter their name and the amount of money they wish to bet on the game (only positive values less than $100 are allowed). The total of all four bets is the price money for the game. •The players will be asked to select which set of words they wish to use for the game. The options are: Fruit Colors Animals Each set of words must have at least seven options (You may choose your own words for each set). Once the players select a set of words the computer will display the full list of options. For example: You have selected the Fruit word set. The possible words are: Apple, Orange, Banana, Kiwi, Strawberry, Grape, Cherry Second: Each game will consist of seven rounds. Each round goes as follows: Each player is…1. Write a pyrhon program that prints out a classic hangman stick figure. The program should ask the user to enter a number from 1-6 and the corresponding hangman should be printed. The value the user inputs corresponds to the number of incorrect guesses in a real hangman game and so the completeness of the hangman will correspond to the number of ‘incorrect guesses’ inputted by the user (e.g., if the user enters 1, then only the head of the hangman will be printed; full example below). Example:Enter a number from 1-6: 1O Enter a number from 1-6: 2O|Enter a number from 1-6: 3O\||Enter a number from 1-6: 4O\|/|Enter a number from 1-6: 5O\|/|/Enter a number from 1-6: 6O\|/|/ \ 2. Modify your program from problem 1 so that the user input is checked to be a validsingle digit (1-6) before printing the corresponding hangman. If the input is not valid, theninstead of a hangman the following message should be printed “Invalid input: you must enter asingle number from 1-6.” Example:Enter a…
- int x=10,y=12,z=13,w=10; X=X+2; //value of X Z=X++ +10; //value of x W=--y +3; //value of y and w and z W=W+X-1; //value of WCreate your own design using JAVA Programming 1. Using Conditional Operator with Scanner enter a grade display either “Passed" or "Failed" Sample Output: Enter your Grades : 74 Enter your Grades : 75 You are FAILED You are PASSED BUILD SUCCESSFUL (total BUILD SUCCESSFUL (total tSummary When you borrow money to buy a house, a car, or for some other purposes, then you typically repay it by making periodic payments. Suppose that the loan amount is L, r is the interest rate per year, m is the number of payments in a year, and the loan is for t years. Suppose that i = (r / m) and r is in decimal. Then the periodic payment is (first image which R=....): You can also calculate the unpaid loan balance after making certain payments. For example, the unpaid balance after making k payments is (second image which L'=....) : where R is the periodic payment. (Note that if the payments are monthly, then m = 12.) Instructions Write a program that prompts the user to input the values of L, r, m, t, and k. The program then outputs the appropriate values. Your program must contain at least two functions, with appropriate parameters, to calculate the periodic payments and the unpaid balance after certain payments. Make the program menu driven and use a loop so that the…
- Java Programming control structures:\ The population of Town A is less than the population of Town . However, the population of Town A is growing faster than the population of Town B. Write a program that prompts the user to enter the population and growth rate of each town. The program outputs after how many years the population of Town Aa will be greater than or equal to the population of Town B and the populations of both towns at that time. Sample input is: Population of Town A = 5,000, growth rate of town A =4%, populatio of Town B = 8,000, and growth rate of town B = 2% Here's my code and something is not right static Scanner console = new Scanner(System.in);public static void main(String[] args) {int populationA;int populationB;int projectedYears; int futurePopulation;double townAGrowthRate;double townBGrowthRate;System.out.print("Enter the population for Town A and Town B "+ "(population of Town A should be less than Town B): \n");populationA = console.nextInt();populationB =…Control structures: In Java only please. Output the position of the largest number and the largest number in the squence a0, a1, a2....ak. For example, the largest number of the squence is 75, 226, 113, 340, 170, 85, 256, 128, 64, 32, 16, 8, 4, 2, 1 is 340, and it's position is 4. Test your program for the following values of x: 75, 111, 678, 732, 873, 2048, and 65535. Thank youScenario As you surely know, due to some astronomical reasons, years may be leap or common. The former are 366 days long, while the latter are 365 days long. Since the introduction of the Gregorian calendar (in 1582), the following rule is used to determine the kind of year: if the year number isn't divisible by four, it's a common year, otherwise, if the year number isn't divisible by 100, it's a leap year. otherwise, if the year number isn't divisible by 400, it's a common year. otherwise, it's a leap year. none of the above year int(input("enter the year")) if (year%4 1-0) and (year%400 -0) or (year % 1000): print (year is common year") else: print(year, is leap year") year= int(input ("enter the year")) if (years !-0) or (year480 1-0) and (year % 1001-0): print(year is common year") else: print(year, "is leap year") D year= int(input("enter the year"))