Hello, I am a beginner and I need help with a game where you have to find the right price (the price is a random number).
class game extends Program{ String name; void intro(){ println("$$$$$$$$$$$$$$$$$$"); println("The price is right"); println("$$$$$$$$$$$$$$$$$$"); println(); print("Press enter to play"); readString(); clearScreen(); print("Enter your name : "); name = readString(); clearScreen(); } void testRightPrice(){ int price = rightprice(); assertTrue(0 <= price && price <= 200); } int rightprice (int Price, int RightPrice){ while ((Price<RightPrice)||(Price>RightPrice)){ if (Price<RightPrice){ println("it's +"); } else { println("it's -"); } } return } int randNum(){ return (int) (0+random()*((200-0)+1)); } /*int lireEntierSecurise(){ print(name + " : "); String reponse = readString(); if (estNombreEntier(reponse)){ return stringToInt(reponse); }else{ println("It's not a number "+ name +", try again"); return lireEntierSecurise(); } } boolean estNombreEntier(String chaine){ boolean valide = true;*/ void algorithm(){ intro(); println("You have to guess the price"); println(rightprice()); } }