Computers and Technology

Write a program called fourrectangleprinter that constructs a rectangle object, prints its location by calling system. out. println(box), and then translates and prints it three more times, so that, if the rectangles were drawn, they would form one large rectangle:

answer
Answers: 1

Similar questions

Предмет
Computers and Technology, 24.10.2019 16:43, annette211pdd8v9
Write a program that generates a random number 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." the program should use a loop that repeats until the user correctly guesses the random number. you shall also keep a 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. now add another loop to ask the user if he or she wishes to play the guessing game again. if so, the loop should repeat, otherwise it should terminate.so far, this is what my program looks like, any or suggestions would be greatly appreciated! // this program generates a random number and askes the user to guess what the number isimport java.util.scanner; import java.util.random; public class guessinggame{public static void main(string [] args){//create a scanner object to read from the keyboardscanner kb = new scanner(system.in); //create a random objectrandom rand = new random(); //identifier declarationsint num = rand.nextint(100) + 1; int guess = 0; int count = 0; int guesses = 0; do{system.out.println("guess what number i have (1-100)? "); guess = kb.nextint(); guesses ++; if(num > guess) {system.out.println("too high, try again."); } else if(num < guess) {system.out.println("too low, try again."); } else {system.out.println("you're right, the number is" + num); system.out.println("you guessed" + guesses + "times"); }}while(guess! =num); }}
Answers: 2
Do you know the correct answer?
Write a program called fourrectangleprinter that constructs a rectangle object, prints its location...

Questions in other subjects: