
Concept explainers
Create a programme that will guess a number entered by the user. In this programme, the user will select a secret number between 1 and maximum. The programme will ask the user to input the maximum figure, which the user will do. The programme will then guess the value of the secret number and allow the user to indicate whether the real value is greater, lower, or accurate. The machine will then guess another number until it correctly predicts the secret number. After each try, the programme should utilise a binary search to restrict its guesses and choose its next guess.
Graph the output of this programme for maximum = 100, 1,000, and 10,000. What do you think about the amount of predictions made by the computer?

Step by stepSolved in 4 steps with 5 images

- Write a program to ask the user to enter "how many quizzes?" he/she has entered in a lecture. The program will ask the grade results of the number of quizzes entered. The program will show the quiz results and the average of the quizzes as an output. As an extra challenge, display the maximum quiz result as well. How many quizzes?6 Enter the grade of Enter the grade of Enter the grade of Enter the grade of Enter the grade of quiz 5 : 30 Enter the grade of quiz 6: 12 Avarage of quizzes: 49 Maximum of quizzes: 95 quiz 1: 30 quiz 2 : 95 quiz 3 : 88 quiz 4 : 52arrow_forwardBaby btc program - python Budget: $75,000 Make a string based bitcoin menu which shows the price of a bitcoin (pseudo random price), able to buy bitcoin with $75,000 budget (say "buy 0.5" meaning buy half of a bitcoin or "buy 3000" meaning buy $3000 worth of bitcoin), able to sell their bitcoin currently owned (using same format), can print their balance (show their current USD, the number of bitcoins they have in their wallet, and USD value of the bitcoins they have), and able to print their buy/sell transaction history.arrow_forwardCreate a flowchart that asks the user to any number (num). These number can either be odd or even. If the number is even, count how many even numbers were inputted and stop until such time that the user inputted 0. For example: Input any positive number – 3 Input any positive number – 6 Input any positive number – 2 Input any positive number – 1 Input any positive number – 8 Input any positive number – 0 The total number of even numbers = 3arrow_forward
- Write a javascript program that calculates how much a person would earn over a period of time. if his or her salary is one dollar the first day and two dollars the second day, and continues to double each day. The program should ask the user for the number of days. Display a table showing how much the salary was for each day, and then show the total pay at the end of the period. Input Validation: Do not accept a number less than 1 for the number of days worked.arrow_forwardA program is needed to manage sales of Super Bowl souvenir t-shirts. There are three types of shirts that we are selling: Chiefs t-shirts Eagles t-shirts Super Bowl t-shirts The t-shirts are all priced at $40 each without any customization. Input: Your program is to display a menu listing each type of shirt. It should then prompt the user for the number of Chiefs t-shirts they would like to order. After the number of Chiefs t-shirts has been entered (which may be 0), if the number was greater than 0, we will ask if they need to add lettering to the shirt (costs 1 dollar per printed letter) the program should continue displaying a prompt and reading the number to order for the other two types of t-shirts in the same way. The program also needs to keep track of the customer name and mailing address. Prompt and read the customer’s name, street address, city, state, and zip code.arrow_forwardWrite a program that asks a user to enter numbers until user enter the commands: max, min or quit. If user enters max then the maximum of all numbers preceding this command and previous command is displayed. If user enters min then the minimum of all numbers preceding this command and previous command is displayed. If user enters quit then end the program If the user enters the following: 8 -9 23 max -9 3 min Мах 3 QuiT Then the program outputs: 23 -9 Assumption: • the command is case-insensitive there is a new-line after every line of the outputarrow_forward
- python: T1 = ( a, b, c) T2= a, b, c where a, b, c are numbers. Question 17 options: T1 == T2 and T1 is T2 T1 != T2 but T1 is T2 T1 == T2 but T1 is not T2 T1 != T2 and T1 is not T2arrow_forwardThe game should begin by randomly dealing 2 cards to the user's hand, and then calculate and display the total. Next the program should display a prompt, asking the user if he/she wants a Hit or to Stand. If the user selects to Hit the game should randomly deal a new card to the user's hand, and then calculate and display the new total. If the total is greater than 21, then the user Busts, the house wins, and a message indicating these results is displayed. If the total is less than 21, repeat the Hit/Stand Prompt to the user. Continue this process until the user elects to Stand or Busts. If the user selects to Stand, the game then randomly deals two cards to the house, and then calculates those total points. The dealer must continue to Hit as long as the total of the House had is under 17, display the results after each Hit The dealer must Stand once the House hand reaches 17 or higher. Once If the user has not already Busted, compare the User's Hand to the House Hand and determine…arrow_forwardCreate a program in pythonthat asks the user to input a number between 20 and 99. The program must then print out the number in English words. If the user does not enter a value between 20 and 99 display an error message stating that the input is not within a valid range.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





