def display(): print("UTAS") def displayNumber(n1, n2): if n1 > n2: return nl * n2 else: return nl - n2 def remarks(number): if number>10: return "SCT"; else: return "HCT"; display() print("Output 1\t:",displayNumber(8,5)) print("Output2\t:",remarks(displayNumber(10,5))
Q: Ex7 / short answer questions / 1. Chapter 15: Change two images using a button Description: Write a…
A: Java allows to create console and GUI window applications. The below controls are used to create…
Q: Please modify the program: Add prompt "Do you want to run the program again; Yes or No" * If…
A: Use do while for asking user about the continuation of the program . below is the code :
Q: Please help!! I don't understand most of the code. Please leave comments as explanations on every…
A:
Q: three textbox arrays A1, A2, A3 contains degrees of 10 stu * three materials. The code to find the…
A: Here we need to add values of A1, A2 and A3. This makes option (a) and (d) incorrect.
Q: Python Programming Question
A: Program code: #Import random package import random #create randomanswers array random_answers=[]…
Q: Python Turtle Graphics Draw a spiral diagram using Python turtle package program follows 3 steps:…
A: Given: Python Turtle Graphics Draw a spiral diagram using Python turtle package program follows 3…
Q: (Display balls with random colors) Write a program that displays ten balls with random colors and…
A: Given: Write a program that displays ten balls with random colors and placed at random locations
Q: Key stroke enacted moving of a ball 1. Start (a) Write a Java program that uses the Up, ↑, Down ↓,…
A:
Q: Write pseudocode that reads two numbers and multiplies them together. Write pseudocode to print all…
A: Pseudocode:- Enter the two numbers X and Y from input medium. Compute and set, product to X * Y…
Q: expression? word = 'object oriented' print word[0] print word[7] print word[5] print word[-1] o, 0,…
A: String: In python, strings are used to store the array of characters. There is no datatype named…
Q: Write a program that reads five cards from the user, then analyzes the cards and prints out the…
A: As no programming language is mention. So i am using c++.
Q: 9: perfect.cpp) A number is called perfect if the sum of its divisors is equal to the original…
A: #include <iostream>using namespace std; const int LIMIT = 5000; int sumOfDivisors(int); int…
Q: Start Enter choice X=n, +n,+n,tn. y=n, "n. [10mumbers)10 True Input the 10 Displayı Sum of B", 5",…
A: - The question wants to the input , process Output and Algorithm of this flowchart provided here.
Q: Time hour = [0, 23] [0, 59] [0, 59] No input validation needed. -hour:int minute |-minute:int…
A: Solution: Given,
Q: What is the output of the following code?
A: The ostream class is represented by the C++ cout expression. It's utilized to generate output for…
Q: Transcribed Image Text Write a Java program that asks the user to enter 5 odd integers. When the…
A: Java is a high-level programming language developed by Sun Microsystems. Instead, Java programs are…
Q: def display_title(): print ("Guess the number!") print () def get_limit (): limit= int (input…
A: Solution::
Q: Example I/O layout: Enter radius of a circle: 5.0 Area of a circle: routput the result in function…
A: C++ Program: #include <iostream>using namespace std; // Declare function areaCirc() Using…
Q: Highlight error, if any, and correct them i. def MyCar (i): print(i) if i print (Doing good!!) elif…
A: Python requires an indented code. In first part elif is used but another condition is not given so…
Q: f the user guesses a letter that is not in the hidden word, display an appropriate message. If the…
A: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace…
Q: KEYBOARD ENTRY EXAMPLE Sample input and output for keyboard entry: Note: Your program does NOT have…
A: // Note: I have given the answer as asked in the question //Note: This is the standard solution…
Q: Write a program that generates a two-column table showing Fahrenheit temperatures from -40F to 120F…
A: 1. declare variable Celsius initialized with 0.0 2. run loop from 0.0 to 120.0 with increment of 5…
Q: ***PLEASE LOOK AT IMAGES AS WELL FOR HELP*** ***PLEASE MAKE IT SIMPLE, I DON'T NEED ANYTHING…
A: The answer is given below:-
Q: Python Coding Create a mini-lottery with TEXT ticket. The user is going to save three numbers…
A: Programming Instructions:Create a python program and declare all required variables as well as…
Q: cerat javaFX 9-Rock, Paper, Scissors Game Create a JavaFX application that lets the user play the…
A: Actually, Java is a programming language originally developed by James Gosling at Sun Microsystems…
Q: Rest of code in image / This is a bad programming style since it is using goto. // This is an…
A: The ask is to make the given program menu-driven with the different functions and errors resolved.
Q: __init__(self, lin, st, sz): # Initializing Variables self.start = 0 self.size = 0…
A: THE PYTHON PROGRAM IS AN GIVEN BELOW :
Q: PYTHON GUI - Tkinker) Write a Python program GUI that reads the following information from user,…
A: user = strend = "0"hours = round(40,2)print("One Stop Shop Payroll Calculator")while user != end:…
Q: (java programming language) Using while do, generate 10 random numbers between 10 to 30 inclusive.…
A: Required: Using while do, generate 10 random numbers between 10 to 30 inclusive. Find the number,…
Q: Ask the user to enter the amount of money he or she wants to insert into the slot machine. Instead…
A: The moment you read the word 'randomly' in a question, you should immediately start thinking about…
Q: Create a java program that will check if a given word is a palindrome or not a palindrome.
A: logic:- iterate from i=0 to length of string -1 check if (userInput.charAt(i) !=…
Q: Fix the errors and send the code please // Application allows user to enter a series of words // and…
A: The code has been reviewed and modified to remove all errors.
Q: Please convert this from Python to C (thank you) def math_game(lv, lmf, lsf, lrf, rv, rmf, rsf,…
A: - We have to implement the python code in c. - We have 8 integers in the function used and the…
Q: Part 2: Write a JavaFX program that simulates a traffic light as shown below. The program should let…
A: JavaFX is a Java library that is used to develop Desktop applications as well as Rich Internet…
Q: This is a program in C language. Help me debug this program. it has 3 errors. Please upload a…
A: Given program is a C++ program, not C program. Because iosteam, cout, cin all these are used in C++.…
Q: Write a Java program that will display the given menu: NOTE: adding a string must accept a…
A: import java.util.*; public class Tester{ public static void main(String[] args) {…
Q: Statistics are often calculated with varying amounts of input data. Write a program that takes any…
A: Program Plan: Since the given condition is to find the last number as the negative integer. So use…
Q: Python Development Lab In Merworld there exists 2 coins of different denominations types 5-peso…
A: Given in the question that we have to develop a python code to find out the number of ways to…
Q: What is wrong in the following code?
A: In the given image (a): The Class circle has an object c1 but when declaring the object “( )” has…
Q: Using C# Language and Visual Studio. Create a guessing game using ArrayList and StringBuilder.
A: Step 1: Declare class GuessWord with field that stores number of attempts made. Step 2: Define…
Q: class Calculator: # Type your code here. if __name__ == "__main__": calc = Calculator();…
A: Solution: Given, class Calculator: # Type your code here. if __name__ == "__main__":…
Q: obj = new B(); obj.i=1; obj.j=2; obj.display(); class A { int i; void display()…
A: Answer: Explanation: In main method we assigned i value as 1 and j value as 2 in display method we…
Q: Look at this program: int main() { int x = 4; displayMessage(); return 0; } void…
A: Any function that is called before it has been defined or declared, will result in a compilation…
Q: Python please: If the score is between 90 and 100, the grade is A, and the teacher comment is…
A: score = int(input("Enter student score: ")) print() if score >= 90 and score <= 100: if…
Q: Graphics / Fonts on digits, characters etc. 1. Generate graphics of digits 0, 1, 2, 3, .., until 8,…
A: “Since you have posted a question with multiple sub-parts, we will solve first three subparts for…
Q: import java.util.Scanner ; //This program enables the user enters 10 int between -100 and 100 //then…
A: After fixing the code, I have provided JAVA CODE along with CODE SCREENSHOT and 2 OUTPUT…
Q: Start Enter choice X=n, +n, +n, +n, y=n, *n. z-([10numbers)10 True Display: Sum of 8", 5", 5", and…
A: The given flowchart is asking the user to enter his/her choice. If the choice is 1, then it is…
Q: Problem Description Write a JAVA program that will read all words from a passage and store them in…
A: The above question is coded in java language. We will be having two files, Program.java,BST.java.
Step by step
Solved in 2 steps
- Java Questions - (Has 2 Parts). Based on each code, which answer out of the choices "A,B,C,D,E" is correct. Each question has one correct answer. Thank you. Part 1 - 9. Given the following code, the output is the date and time of __.Calendar cal = Calendar.getInstance(); TimeZone tz = TimeZone.getTimeZone("Europe/Rome");TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");TimeZone tz = TimeZone.getTimeZone("Asia/Istanbul");System.out.println(cal.getTime()); A. the "Europe/Rome" time zone.B. the time zone is computer is currently set to use.C. the "America/Los_Angeles" time zone.D. the "Asia/Istanbul" time zone.E. All of the three listed time zones. Part 2 - 10. Given the following code, the output is the date and time of __. Calendar cal = Calendar.getInstance();TimeZone tz = TimeZone.getTimeZone("Europe/Rome");cal.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));TimeZone tz = TimeZone.getTimeZone("Asia/Istanbul");System.out.println(cal.getTime()); A. the "Europe/Rome"…Problem Description: The international standard letter/number mapping found on the telephone keypad is shown below: Write a pseudocode and program that reads a letter and displays its corresponding digit. 2 3 1 ABC DEF 4 5 6 GHI JKL MNO 7 8 9 PQRS TUV WXYZ 0 Write a pseudocode on how you would solve the problem in your own word. Write a java program called Phone considering the following directions. Practice here first then write answer on the answer sheet. Also, make sure distinguish high and low caps as Java is case – sensitive. Import and declare a Scanner class Ask user for an Upper – case letter Use the switch statement along with case and break Use the System.exit(1) in the default to terminate the program Print the corresponding digit***PLEASE LOOK AT IMAGES AS WELL FOR HELP*** Write a program that reads five cards from the user, then analyzes the cards and prints out the category of poker hand that they represent. Poker hands are categorized according to the following labels: Straight flush, four of a kind, full house, straight, flush, three of a kind, two pairs, pair, high card. To simplify the program we will ignore card suits, aces, and face cards. The values that the user inputs will be integer values from 2 to 9. When your program runs it should start by collecting five integer values from the user. It might look like this (user input is in bold red for clarity): Enter five numeric cards, no face cards. Use 2 - 9.Card 1: 8 Card 2: 7Card 3: 8Card 4: 2Card 5: 3 (This is a pair, since there are two eights) Since we are ignoring card suits there won’t be any flushes. Your program should be able to recognize the following hand categories, listed from least valuable to most valuable: Hand Type…
- Slot Machine Simulation- I need to get answer in Pseudocode A slot machine is a gambling device that the user inserts money into and then pulls a lever (or presses a button). The slot machine then displays a set of random images. If two or more of the images match, the user wins an amount of money, which the slot machine dispenses back to the user. Design a program that simulates a slot machine. When the program runs, it should do the following: Ask the user to enter the amount of money he or she wants to insert into the slot machine. Instead of displaying images, the program will randomly select a word from the following list: Cherries, Oranges, Plums, Bells, Melons, Bars The program will select and display a word from this list three times. If none of the randomly selected words match, the program will inform the user that he or she has won $0. If two of the words match, the program will inform the user that he or she has won two times the amount entered. If three of the words…getRandomLib.h: // This library provides a few helpful functions to return random values// * getRandomInt() - returns a random integer between min and max values// * getRandomFraction() - returns a random float between 0 and 1// * getRandomFloat() - returns a random float between min and max values// * getRandomDouble() - returns a random double between min and max values// * getRandomBool() - returns a random bool value (true or false)// * getRandomUpper() - returns a random char between 'A' and 'Z', or between min/max values// * getRandomLower() - returns a random char between 'a' and 'z', or between min/max values// * getRandomAlpha() - returns a random char between 'A' and 'Z' or 'a' and 'z'// * getRandomDigit() - returns a random char between '0' and '9', or between min/max values// * getRandomChar() - returns a random printable char//// Trey Herschede, 7/31/2019 #ifndef GET_RANDOM_LIB_H#define GET_RANDOM_LIB_H #include <cstdlib>#include <random>#include…In C# language using Microsoft Visual Studio in Windows Forms App (.NET Framework) A slot machine is a gambling device that the user inserts money into and then pulls a lever (or presses a button). The slot machine then displays a set of random images. If two or more of the images match, the user wins an amount of money, which the slot machine dispenses back to the user. Design a program that simulates a slot machine. When the program runs, it should do the following: Ask the user to enter the amount of money he or she wants to insert into the slot machine. Create an application that simulates a slot machine. The application should let the user enter into a TextBox the amount of money he or she is inserting into the machine. When the user clicks the Spin button, the application should display three randomly selected symbols. (Slot machines traditionally display fruit symbols.
- Turtle Graphics Drawings Use the turtle graphics library to write programs that reproduce each of the designs shown inFigure 2-34. Figure 2-34 Designs, the first drawing (squares)(PYTHON GUI - Tkinker) Write a Python program GUI that reads the following information from user, and prints a payroll statement: Employee’s name (e.g., Smith) Number of hours worked in a week (e.g., 10) Hourly pay rate (e.g., 60.75) ATO tax withholding rate (e.g., 30%) Medicare Levy rate (e.g., 2%)Instructions: 1. This java program is for an application that stores the author (Writer) data of some books and emails. 2. getAuthors() method get the list of authors and store it in a String array. 3. addAuthors() method is used to add an author anytime for book or email. 4. getDate() method get the date of the book or email. 5. getTitle() method can be used to get the title of the book. 6. getSubject() method is used to get the Subject of the email. 7. getTo() method is used to get the information about the mail to whom it is sent. 8. All get methods need to return the values in the corresponding instance variables. 9. Scanner class can be used to set the data for the variables. The programmer can give his/her own methods to set the instance variables
- #Write your class code here using python print("Box 1")b1 = box([10,10,10])print("=========================")print("Height:", b1.height)print("Width:", b1.width)print("Breadth:", b1.breadth)print("-------------------------")print("Box 2")b2 = box((30,10,10))print("=========================")print("Height:", b2.height)print("Width:", b2.width)print("Breadth:", b2.breadth)b2.height = 300print("Updating Box 2!")print("Height:", b2.height)print("Width:", b2.width)print("Breadth:", b2.breadth)print("-------------------------")print("Box 3")b3 = b2print("Height:", b3.height)print("Width:", b3.width)print("Breadth:", b3.breadth)HELP NEEDED ASAP! Language: JAVA Write a program in Java that takes an integer value as input from the keyboard and prints a pattern like a right-angle triangle with the line number. For input value 4 the pattern is as follows: 1 22 333 4444 Hint: use nested loops.Edit question Write a Java program in java eclipse ide Generate 35 “even” random integer numbers in range [1000, 9999], display these numbers in 4 lines - display 10 numbers per line (10x3=30), display the remaining numbers (5) in the last line Find the maximum and the minimum numbers from these 35 even numbers. Display these 2 values. Find the average of these 35 random numbers. Display average value.