Value returning method Write a program to calculate items sale price
Q: PYTHON HOMEWORK QUESTION def area(side1, side2): return side1 * side2 s1 = 12 s2 = 6 Select…
A: Here, a function area is defined which is accepting 2 arguments and then returning the area by…
Q: def area(side1, side2): return side1 * side2 s1 = 12 s2 = 6 Identify the statements that…
A: A. print(f'The area is {area(s1,s2)}') B. answer = area(s1,s2) D. area(s1,s2)
Q: Fibonacci sequence: The first two numbers of the fibonacci sequence are 1 and 1, and sequential…
A: Since you have not specified programming language, I have written program in Python programming…
Q: Each code example is incorrect. Indicate why! (2 errors each) 1. if (i=0)// //...code…
A: Computer programming or the code is the communication between computers and users. Creating a code…
Q: Rolling Dice Simulator in C Difficulty: Requirements: • As the title suggests, this…
A: The C code is given below with output and explanation
Q: Write a program to determine the price for a portrait sitting. The price is determined by subjects…
A: A program to determine the price for a portrait sitting: #include <iostream>using namespace…
Q: Distance Traveled ModificationThe distance a vehicle travels can be calculated as follows:…
A: Initially speed of a vehicle is defined as the distance travelled over unit time. i.e Speed =…
Q: Golf scores record the number of strokes used to get the ball in the hole. The expected number of…
A: Step 1 : STARTStep 2 : declare all variablesStep 3 : input par and strokeStep 4 : using if else if…
Q: Java Program
A: I have provided JAVA CODE along with CODE SCREENSHOT and OUTPUT…
Q: PLEASE FIX AND MODIFY THIS JAVA PROGRAM SO WHEN I UPLOAD IT TO HYPERGRADE IT PASSES ALL TEST CASSES…
A: Algorithm: Retail Price Calculator1. Create a class named RetailPriceCalculator.2. Define a static…
Q: Interest Rates Savings accounts state an interest rate and a compounding period. If theamount…
A: EXPLANATION Below is the answer for the given question. Hope you understand it well. If you have any…
Q: S Input Format Two integer values s, h. s representing the speed and h representing the trip's…
A: Code #include <iostream> using namespace std; int main(){ int speed,time,distance;…
Q: Write a Java program that calls a method from main and passes it two integer parameters called…
A: The answer to the following question:-
Q: Financial Application:• Write a program that computes future investment value at a given interest…
A: Program plan:Import necessary packages.Define a class named “Investment”.Define a method named…
Q: Write an algorithm that gets student exam scores from the user. Each exam score will be an integer…
A: Given: We have to write an algorithm that gets student exam scores from the user. Each exam score…
Q: Write a program that accepts the feet value as an argument and returns the corresponding inches…
A: Algorithm : feet_to_inch function : Step 1 : declare variable. Step 2 : find the inch from feet by…
Q: True or False The nouns in a problem description may indicate some of the methods needed in a…
A: In object oriented programming language, if the problem description contains nouns then they may…
Q: Use Visual Basic Write a RainFall program that stores the total rainfall for each of 12 months into…
A: import java.util.Scanner;class rainFall { public static void main(String[] args) { Scanner keyboard…
Q: In arithmetic, variables look like
A: The problem is based on the basics of variables in programming laguages.
Q: The data type bool: Group of answer choices Can only be used in a selection statement. Can…
A: Can take on values true and false. because boolean variable are defined to satisfy the binary…
Q: object oriented programming (OOP) write a program that store the 10 numbers and then calculate the…
A: object oriented programming (OOP) write a program that store the 10 numbers and then calculate the…
Q: Note: Help me debug and complete code The program should do the following: Show the customer the…
A: Program: Programs contain a set of lines of code, where the instructions are given through these…
Q: UNSING JAVA: Write a program that analyzes an object falling for 10 seconds. It should contain main…
A: Purpose: In this program we need to analyzes an object falling for 10 seconds and in this we need…
Q: C# Question Write a statement that declares a variable called even and assigns it to the value…
A: Given: C# Question Write a statement that declares a variable called even and assigns it to the…
Q: Golf scores record the number of strokes used to get the ball in the hole. The expected number of…
A: The objective of the question is to write a program that takes two integers as input, representing…
Q: Problem Description The hailstone sequence is defined as the integer sequence that results from…
A: Python programming language : Python is a programming language that Guido van Rossum created in the…
Q: Questions #2: Assets Depreciation Program Businesses fixed assets, such as buildings, equipment,…
A: Algorithm: Start Read price, salvage and years used Calculate d=(p-s)/y Set…
Q: Area and Perimeter: Write a program that prints the area and perimeter of a circle with a radius of…
A: Solution: Approach: Create a class circle In the main method declare the variables radius, area,…
Q: This program assigns values to two variables // and performs mathematical operations with them
A: Errors 1. System.out.println("adding " + x + y); The above statement concatenates the value of x and…
Q: The value passed through the parameter is called a(n). Index argument statement number
A: Lets see the solution
Q: Golf scores record the number of strokes used to get the ball in the hole. The expected number of…
A: Prompt the user to enter the strokes and then par score. Store the received values in score and par.…
Q: Create a program that has the following methods and corresponding usage. AreaCircle - compute…
A: Introduction: In this question, we are asked to write a C# programming to create the two methods :…
Q: PYTHON programming solotion Develop a program that allows the user to enter a start value of 1 to…
A: I have provided PYTHON CODE along with CODE SCREENSHOT and OUTPUT…
Q: Python Progamming Topic: Conditionals Qyestion: Write a program that simulates the throwing of…
A: Python code for above : import random def main(): dice1 = random.randint(1, 9) dice2 =…
Q: All the Same Letter Write a method to determine if all the letters in a String are the same letter.…
A: Programs: Programs are used to provide instructions to the computer system in order to solve complex…
Q: What is the benefit of being able to define an initial value when you can assign a value to a…
A: Introduction: Variables hold data like numbers and words, whereas operators are symbols that execute…
Q: The Lottery Problem: • The lottery draws a number that is the winning number • The…
A: ANSWER: LotteryProblem.vb: Module VBModuleSub Main()'This is for lottery number between 0 and 999…
Q: import math # Lab 3 - Road Trip # Program determines the time it takes to complete a road trip from…
A: 1. Start the program.2. Initialize a dictionary named "distance_to_city" with distances from Chicago…
Q: ert feet into meters: Write a program which reads the number in feet, converts it to meters, and…
A: Code: #include <iostream>using namespace std;int main(){ float feet, meters,inches;…
Q: Create structured, commented Python 3 code to determine any individual number's position on the…
A: def checkEvenOdd(n): if n == 0: print("The entered number is 0") elif n % 2 == 0:…
Q: JAVA PROGRAM Chapter 5. PC #2. Retail Price Calculator (page 312) Write a program that asks the…
A: The Java program is designed to calculate the retail price of an item given its wholesale price and…
Q: Looping for Statements Write a program that will display a multiplication table with the format…
A: Answer in step 2
Q: Prompt Problem: A company wants a program that will calculate the weekly paycheck for an employee…
A: Flowchart:
Q: As one variable goes up, the other variable goes down” is a description of:
A: Correlation is a method of statistical measure which is expressing the extent to of two variables…
Q: The area of rectangle can be calculated with the following fomula: Area = Width X Height Assuming…
A: As You have not Mentioned the language I am going to do it in C++, if you want a solution in another…
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images
- int stop = 6; int num =6; int count=0; for(int i = stop; i >0; i-=2) { num += i; count++; } System.out.println("num = "+ num); System.out.println("count = "+ count); } }def area(side1, side2): return side1 * side2s1 = 12s2 = 6Identify the statements that correctly call the area function. Select ALL that apply. Question options: area(s1,s2) answer = area(s1,s2) print(f'The area is {area(s1,s2)}') result = area(side1,side2)JAVA CODE PLEASE FINAL EXAM Part 2 Instructions: Modulo or Remainder Operator returns the remainder of the two numbers after division. If you are provided with two numbers, say A and B, A is the dividend and B is the divisor, A mod B is there a remainder of the division of A and B. Modulo operator is an arithmetical operator which is denoted by %. Create a program that asks the user to enter two values then get the remainder of the two values and create a print statement to print the result. All statements should be inside of Modulo function. Call the Modulo function in your main function using the "function with no parameters and return values" method. Constraint: Apply the User-defined Functions type of function. Input 1. Dividend Sample 11 2. Devisor Sample 5 Output Enter·dividend:·11 Enter·divisor:·5 Remainder:·1
- True or FalseA value-returning method must contain a return statement.C++ program int quadrant() This method will return at which quadrant does this point lie in our Cartesian plane. You may use the internet to recall your quadrants in the Cartesian coordinate system. This method will return 1 if it is in Quadrant I (+, +), 2 if it is in Quadrant II (-, +), 3 if it is in Quadrant III (-, -), and 4 if it is in Quadrant IV (+, -). If the point lies in the x-axis, return -1. If the point lies in the y-axis, return -2, if the point is in the origin, return 0.Student name: CIS 232 Introduction to Programming Homework Assignment 10 Due Date: 11/23/2020 Instructor: Dr. Lomako Problem Statement: Write a Java program with the main method and a multiplication method (must be created, not the library method). Create “HW10_lastname.java” program that: Prints a program title Creates two n x n square matrices A and B and initializes them with random values Displays the matrices A and B Calls the multiplication method that multiplies two square matrices and returns a matrix AB that is the result of the multiplication. Prints AB matrix
- Financial Application:• Write a program that computes future investment value at a given interest rate for aspecified number of months and prints the report shown in the sample output. • Given the annual interest rate, the interest amount earned each month is computedusing the formula: Interest earned = investment amount * annual interest rate /1200 (=months * 100) • Write a method, computeFutureValue, which receives the investment amount, annualinterest rate and number of months as parameters and does the following: o Prints the interest amount earned each month and the new value of theinvestment (hint: use a loop). o Returns the total interest amount earned after the number of months specified bythe user. The main method will:o Ask the user for all input needed to call the computeFutureValue method.o Call computeFutureValueo Print the total interest amount earned by the investment at the end of thenumber of months entered by the user. Sample Program runningEnter the investment…Part 4 Guessing game (random and absolute) Write a program that does this: You (as programmer) are the dealer. Pick a random number for yourself (between 0 and 100). Ask the user to input a random number (between 0 and 100). Whoever is closer to 21 wins the game. If the dealer wins, say "Dealer wins." If the user wins, say “Player wins”. Example output: Player please pick a number. 45 Dealer has 25 Dealer wins. Part 5 Guessing game loop (keeping a counter) Write the same program as in part 4, but keep it going so that it keeps playing (dealing hands and saying who wins) until the User enters the number 21 at which point you print out some stats and say goodbye, for example, your goodbye might look like this: Number of hands played: 5 Dealer won: 3 Player won: 2 You're 2 for 5 Come back to thePower Calculator Java Script Create a function that takes voltage and current and returns the calculated power. Examples circuitPower (230, 10) → 2300 circuitPower (110, 3) → 330 circuitPower (480, 20) → 9600
- Name: Instructor Course: ITSE 2321 Object-Oriented Programming (Java) Program: Four This program computes an employee's gross, net, and overtime pay. Enter your ID Number: 1001 Enter your pay rate: 12.50 Enter your hours worked: 36 Program 4 ID Number: Pay Rate: Regular Hours: Overtime Hours: Total Hours: Regular Pay: Overtime Pay: Gross Pay: Tax: Deductions: Net Pay: 1001 12.50 36.00 0.00 36.00 450.00 0.00 450.00 0.00 35.00 415.00TRUE-FALSE: Type YES if the given statement is correct. Otherwise, type NO. Analyzing information nowadays is easier than in the past.