myNum RANDOM(1, 10) IF (myNum > 8) DISPLAY("Done") ELSE DISPLAY(myNum) myNum RENAT UNTIL (myNum 8) RANDOM(1, 10) DISPLAY(myNum) myNum RANDOM (1, 10) DISPLAY("Done") myNumRANDOM(1, 10) IF (myNum < 8) DISPLAY("Done") ELSE { DISPLAY(myNum) myNum RANDOM (1, 10) REPEAT UNTIL (myNum 8) DISPLAY(“Done") DISPLAY(myNum)
Q: 2. Temp conversion This program, prompts the user to enter either an 'F' for Fahrenheit or 'C' for…
A: Java is a high-level programming language promoted by Sun Microsystems. Alternatively, Java programs…
Q: Cracked Egg Game: There are a dozen eggs in a basket; some are hard boiled and some are raw. The…
A: Program: import random # for simulation hard_boiled = 0print("**** Hard Biled Eggs Game ****\n")…
Q: rite a Java application that uses the Math class to determine the answers for each of the following:…
A: a. The square root of 30 in java : program : import java.util.Scanner; public class…
Q: public class Password { String password; String SPECIAL_SYMBOLS = "!@#$%^&*"; public boolean…
A: import java.util.*; class Password { String password;String SPECIAL_SYMBOLS = "!@#$%^&*"; public…
Q: Python Programming Question
A: Program code: #Import random package import random #create randomanswers array random_answers=[]…
Q: // TODO validity checking for all other constructor arguments this.name = null; this.lines = null;…
A: The answer is given below.
Q: Tic-Tac-Toe For this question, you will be implementing a simple Tic-Tac-Toe game without the…
A: Define displayBoard() function to display the game board. Define hasWon() function to check whether…
Q: public Account(String name) - Constructor: create an account with the given name and initial balance…
A: In Java, classes are collections of variables and functions that operate on those variables. The…
Q: Eclass Fruits: def init (self, fruitname, price, qty): self.price price %3D self.qty qty…
A: class Employee: def __init__(self,name,age): self.age=age…
Q: A class plays a fishing game in which a large tub is filled with plastic fish that are identical,…
A: 1. Data in a dot plot:
Q: Kinetic Energy In physics, an object that is in motion is said to have kinetic energy. The following…
A: Program: #include <iostream>using namespace std;double kineticEnergy(double mass, double…
Q: Microsoft Visual C#, 7th edition. chapter 11, Programming exercise 11-3 Instructions: Write the…
A: Algorithm: Start Read a number If number is greater than or equal to 0, print Math.sqrt(number)…
Q: Complete the code in the Practice class such that each time the user clicks the SUM button, the sum…
A: We need to fix the code: See below step for code and output
Q: QUESTION3. The program will ask the user to enter the width and length of a rectangle, and then…
A: Given:
Q: A player needs to collect a map and a shovel to look for the treasure. The following code check if…
A: if has_shovel and has_map: #if both are true print("Look for the treasure") elif…
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: Create the BookstoreCredit class. The computeDiscount method calculates a discount based on a…
A: JAVA Program: import java.util.Scanner; // Creating the class BookstoreCreditpublic class…
Q: Task 1: The board is numbered like shown in the above figure. So that you can ask the player to tell…
A: Algorithm: Start Display the board to the user Initialize count to 0 Initialize turn to 'X'…
Q: symbol: variable circleArea location: class Geometry Geometry.java:114: error: cannot find symbol…
A: Below is the code :-
Q: QUESTION3. The program will ask the user to enter the width and length of a rectangle, and then…
A: import java swing j option pane Create a class Rectangle with tow integer variable width and length…
Q: Please create a scoreboard of two players(x or o) every time a tic tac toe new match start. Please…
A: Code in step 2
Q: public class PSP6 { public static void main(String[] args) { System.out.println(finalCarPrice(1));…
A: According to the Question below the Solution: Output:
Q: d has a number written on it R1 starts at the top left corner square of starts at the top right…
A: Given we are required to develop a python script to compute the maximum score
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: Write a toString method. The text representation of a receipt should include: the text…
A: import java.util.Scanner;public class Receipt { private String storeName; private…
Q: a. You have arranged a party to celebrate 31 December 2020 and you have invited all your friends.…
A: rand() is used to generate random number rand() % 2 will give random 1 or 2 1 for head and 2 for…
Q: class Surprise: def mystery (self,n) : print ("h(" ,n,")") if (n==0): print ("value: 0") return 0…
A: class Surprise(): def mystery(self,n): print("hello")…
Q: Please create a tic tac toe game using any programming language. Please include graphics, a score…
A: Lets see the solution in the next steps
Q: When the value of an item is dependent on other data and that item is not updated when the other…
A: Answer is given below,
Q: Given two integers as user inputs that represent the number of drinks to buy and the number of…
A: Start Input purchase Input restore Call the function and print the updated inventory Stop
Q: Implement the class Character The role should be “primary” or “secondary” all other values are…
A: Begin Enter name Enter role Enter gender Enter age Enter salary Print using toString() End
Q: #include "TerminalPlayer.h" Card TerminalPlayer::playCard(const Card& opponentCard) { // if the…
A: Answer: I have done code in C++.also I have attached code
Q: Write an application that determines whether a phrase entered by the user is a palindrome. A…
A: import java.util.*; class palindrome{ void palin(){System.out.print("Enter the string you want…
Q: Java code you will create a simple console-based game (user vs. computer) using selection and…
A: Java steps to generate a random number in a range of 0 to N(excludes) : The java statement to…
Q: Object Orientation Please use Arrays or ArrayLists where appropriate Implement a…
A: Time Complexity: O(n) Space Complexity: O(1) Algorithmic Paradigm: Divide and conquer.…
Q: Create a simple game that will allow user to guess the secret number.
A: Note: As per the guidelines we are allowed to answer the only first question for multiple-type…
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: To compare if the original cells are kept in the cells * * For example, cell 1 1 in original cell is…
A: Program1 class Test{ public static void main(String[] args) { int[] arr=…
Q: Java Class: Fundraiser You are a fundraising distributor who needs to to pre-sell a limited number…
A: A java program is defined as a class with a main function defined inside the class. The main program…
Q: java code Fields and methods given Book Fields String title String author int copies Methods…
A: ALGORITHM:- 1. Declare the given class. 2. Add the methods in it as defined. 3. Print the results.…
Q: Do the following: Add buttons for all the numbers in a calculator (0-9). Look at a calculator…
A: Java code :
Q: Create an application that lets the user play the game of Rock, Paper, Scissors against the…
A: Program: import randomrandom.seed(300)def determineWinner(playerChoice, computerChoice): #…
Q: A university has the following dormitories: Allen Hall: $1,500 per semester Pike Hall: $1,600 per…
A: Actually, Java is a programming language originally developed by James Gosling at Sun Microsystems…
Q: create using a Java programming A city bank offers two different types of bank account, a saving…
A: The program comprises 4 classes. Account, SavingAccount, CheckingAccount, and Main class. The…
Q: Create a modularized Rock, Paper, and Scissors game that lets user play 7 Rock, Paper, and Scissors…
A: Actually, given information: getComputerChoice receives nothing but returns a word randomly picked…
Q: Pig is a game that has two players that alternate turns rolling dice. In this case, there will be…
A: Game's requirements: If any player rolls 1 on a dice, then there is no point awarded and turn ends.…
Q: Objective: Write a program that allows the user to play a "Choose Your Own Adventure" game. In this…
A: Program in Java. Code: import java.util.Scanner; //classpublic class Main{ //main function public…
Q: • getLength ()–This method should ask the user to enter the rectangle's length, and then return that…
A: The required Java code is: import java.util.Scanner;public class rectangle { double length;…
Q: Check the following method header: public void displayValue(int value) {…
A: To Check the method header: public void displayValue(int value) { Which code segment contains a…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Create a CompanyDriver application. You will have at least 2 methods in this application, Create a menu. main() – setCompanyData() - this reads the data from the file (call the file CompanyData.txt) displayCompanyData() - this displays the data to the screen, calling the toString() method of all objects //sortData() - This will sort the data by choice either name of stock or current price / This will be part of lab 7. //Create an arraylist of the 10 Company objects and display them. You may want to make this a method. This will be part of lab 7 Create an array of the 10 Company objects and display them. You may want to make this a method. Read the data from a file (see below) Call each method as described above CompanyData.txt (the data is set up like this: (Company name, lastprice, current price - copy and paste this into a .txt file) GoPro, Inc.10.7113.69Starbucks59.5358.46JC Penney7.7310.78Amazon531.07576.32Adams Resources and…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…The mean of a list of numbers is its arithmetic average. The median of a list is its middle value when the values are placed in order. For example, if an ordered list contains 1, 2, 3, 4, 5, 6, 10, 11, and 12, then the mean is 6, and their median is 5. Write an application that allows you to enter nine integers and displays the values, their mean, and their median.
- Attached Files: 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 // // #define GET_RANDOM_LIB_H #include <cstdlib> #include <random> #include <ctime> using namespace…Random Number Guessing Game Create an application that generates a random number in the range of 1 through 100 and asks the user to guess what the number is. If the user’s guess is higher than the random number, the program should display “Too high, try again.” If the user’s guess is lower than the random number, the program should display “Too low, try again.” If the user guesses the number, the application should congratulate the user and then generate a new random number so the game can start over. Optional Enhancement: Enhance the game so it keeps count of the number of guesses that the user makes. When the user correctly guesses the random number, the program should display the number of guesses.Please help with Java code. Create student class Name Id Marks Create array of 10 student and print all students
- a. The mean of a list of numbers is its arithmetic average. The median of a list is its middle value when the values are placed in order. For example, if a list contains 1, 4, 7, 8, and 10, then the mean is 6 and the median is 7. Write an application that allows you to enter five integers and displays the values, their mean, and their median. Save the files as MeanMedian.java. b. Revise the MeanMedian class so that the user can enter any number of values up to 20. If the list has an even number of values, the median is the numeric average of the values in the two middle positions. Save the file as MeanMedian2.java.Treasure Hunter description You are in front of a cave that has treasures. The cave canrepresented in a grid which has rows numbered from 1to , and of the columns numbered from 1 to . For this problem, define (?, )is the tile that is in the -th row and -column.There is a character in each tile, which indicates the type of that tile.Tiles can be floors, walls, or treasures that are sequentially representedwith the characters '.' (period), '#' (hashmark), and '*' (asterisk). You can passfloor and treasure tiles, but can't get past wall tiles.Initially, you are in a tile (??, ). You want to visit all the treasure squares, andtake the treasure. If you visit the treasure chest, then treasurewill be instantly taken, then the tile turns into a floor.In a move, if you are in a tile (?, ), then you can move tosquares immediately above (? 1, ), right (?, + 1), bottom (? + 1, ), and left (?, 1) of thecurrent plot. The tile you visit must not be off the grid, and must not be awall patch.Determine…1.9: DiamondWrite an application that prints the following diamond shape. Don’tprint any unneeded characters. (That is, don’t make any characterstring longer than it has to be.) (You may need to scroll to see everything.)***************************************** SAMPLE RUN #0: java Diamond