CIS115 Full Course Project Latest 2020 December

Question

Dot Image

CIS115 Programming Logic and Design

Week 4 Course Project    

The Week 4 portion of your Course Project is due this week. Please refer to the Course Project Overview in the Introduction and Resources module for full details. Use this report (Links to an external site.) to complete this portion of the project.

Guess the number!

You will create a program that will ask the user to guess a number between 1 and 10. The pseudocode is below. Be sure to import random at the beginning of your code and use a comment block explaining what your program does

#Guess the number week 4

#Name:

#Date:

#Random number, loop while true

#ask user for number.

#if number is too high or too low, tell user, if they guessed it break out of loop

Display “Welcome to my Guess the number program!”

random mynumber

while True

    Display “Guess a number between 1 and 10”

    Get guess

    if (guess<mynumber)

         Display “Too low”

    else if (guess>mynumber)

         Display “Too high”

    else if (guess==mynumber)

         Display “You guessed it!”

When you run your program the result should be something like this:

Welcome to my Guess the number program!

Please guess a number between 1 and 10: 5

Too high

Please guess a number between 1 and 10: 4

Too high

Please guess a number between 1 and 10: 3

Too high

Please guess a number between 1 and 10: 2

You guessed it!

 

CIS115 Programming Logic and Design

Week 5 Course Project    

The Week 5 portion of your Course Project is due this week. Please refer to the Course Project Overview in the Introduction and Resources module for full details. Use this report (Links to an external site.) to complete this portion of the project.

Guess the number!

You will add to the program you created last week. This week you will add input validation and a count to show how many guesses the user took before getting the correct number. The pseudocode is below. Be sure to import random at the beginning of your code and use a comment block explaining what your program does

#Guess the number week 5

#Name:

#Date:

#Random number, loop while true

#ask user for number. Check to see if the value is a number between 1 and 10

#if number is too high or too low, tell user, if they guessed it break out of loop

Display “Welcome to my Guess the number program!”

random mynumber

count=1

while True

   try

      Display “Guess a number between 1 and 10”

      Get guess

      while guess<1 or guess>10

          Display “Guess a number between 1 and 10”

          Get guess

    except

         Display “numbers only”

          continue

    if (guess<mynumber)

         Display “Too low”

         count=count+1

    else if (guess>mynumber)

          Display “Too high”

          count=count+1

    else if (guess==mynumber)

        Display “You guessed it in “+ count + ” attempts”

 When you run the program the result should look like the following:

Welcome to my Guess the number program!

Please guess a number between 1 and 10: a

Numbers only!

Please guess a number between 1 and 10: -3

Please guess a number between 1 and 10: 4

Too low

Please guess a number between 1 and 10: 5

Too low

Please guess a number between 1 and 10: 6

You guessed it! It took you 3 attempts

 

CIS115 Programming Logic and Design

Week 6 Course Project    

The Week 6 portion of your Course Project is due this week. Please refer to the Course Project Overview in the Introduction and Resources module for full details. Use this report (Links to an external site.) to complete this portion of the project.

Guess the number!

You will add to the program you created last week. This week you will add quite a bit of code to your project. You will add an option for the computer to guess as well as the user to guess a number. In addition, you will add a menu system. Be sure to import random at the beginning of your code and use a comment block explaining what your program does

#Guess the number week 6

#Name:

#Date:

#Menu system displays – ask user if they want to guess a number, have computer guess a number, or exit

#Random number, loop while true

#ask user for number. Check to see if the value is a number between 1 and 10

#if number is too high or too low, tell user, if they guessed it break out of loop

#ask user to enter a number, computer randomly guesses

Display “Welcome to my Guess the number program!”

while true

   Display “1. You guess the number”

   Display “2. You type a number and see if the computer can guess it”

   Display “3. Exit”

   Get option

   if(option ==1)

      random mynumber

      count=1

      while True

         try

            Display “Guess a number between 1 and 10”

            Get guess

            while guess<1 or guess>10

                 Display “Guess a number between 1 and 10”

                  Get guess

        except

              Display “numbers only”

              continue

      if (guess<mynumber)

             Display “Too low”

             count=count+1

       else if (guess>mynumber)

              Display “Too high”

              count=count+1

        else if (guess==mynumber)

             Display “You guessed it in “+ count + ” attempts”

   if(option ==2)

      Get number from user

      count=1

      while True

         Get randomval from computer

         if (number<randomval)

            Display “Too low”

            count=count+1

         else if (number>randomval)

            Display “Too high”

            count=count+1

         else if (number==randomval)

             Display “The computer guessed it in “+ count + ” attempts. The number was “+randomval

   else

        break

When you run the program you should see something like the following:

Welcome to my Guess the number program!

You guess the number

You type a number and see if the computer can guess it

Exit

What is your choice: 1

Please guess a number between 1 and 10: 8

Too high

Please guess a number between 1 and 10: 7

You guessed it! It took you 2 attempts

You guess the number

You type a number and see if the computer can guess it

Exit

What is your choice: 2

Please enter a number between 1 and 10 for the computer to guess: 5

The computer guessed 7 which is too high

The computer guessed 2 which is too low

The computer guessed 9 which is too high

The computer guessed 8 which is too high

The computer guessed 8 which is too high

The computer guessed 1 which is too low

The computer guessed 3 which is too low

The computer guessed 4 which is too low

The computer guessed 2 which is too low

The computer guessed 8 which is too high

The computer guessed 3 which is too low

The computer guessed 1 which is too low

The computer guessed 4 which is too low

The computer guessed 7 which is too high

The computer guessed 1 which is too low

The computer guessed 7 which is too high

The computer guessed 1 which is too low

The computer guessed 4 which is too low

The computer guessed 4 which is too low

The computer guessed it! It took 20 attempts

You guess the number

You type a number and see if the computer can guess it

Exit

What is your choice: 3

Thank you for playing the guess the number game!

 

CIS115 Programming Logic and Design

Week 7 Course Project    

The Week 7 portion of your Course Project is due this week. Please refer to the Course Project Overview in the Introduction and Resources module for full details. Use this report (Links to an external site.) to complete this portion of the project.

Guess the number!

You will add to the program you created last week. This week you will add a list to keep track of all the numbers guessed and modularize your code. Be sure to import random at the beginning of your code and use a comment block explaining what your program does

#Guess the number week 7

#Name:

#Date:

#Menu system displays – ask user if they want to guess a number, have computer guess a number, or exit

#Random number, loop while true

#ask user for number. Check to see if the value is a number between 1 and 10

#if number is too high or too low, tell user, if they guessed it break out of loop

#ask user to enter a number, computer randomly guesses

display_menu() module

   Display “1. You guess the number”

   Display “2. You type a number and see if the computer can guess it”

   Display “3. Exit”

main() module

   Display “Welcome to my Guess the number program!”

   while true

      display_menu()

      Get input

       if(option==1)

           user_guess()

       elif(option==2)

            computer_guess()

       else

          break

user_guess() module

      random mynumber

      count=1

      userGuesses=[]

      while True

         try

            Display “Guess a number between 1 and 10”

            Get guess

            while guess<1 or guess>10

                Display “Guess a number between 1 and 10”

                Get guess

         except

            Display “numbers only”

            continue

         userGuesses.append(guess)

         if (guess<mynumber)

             Display “Too low”

             count=count+1

         else if (guess>mynumber)

              Display “Too high”

              count=count+1

         else if (guess==mynumber)

              Display “You guessed it in “+ count + ” attempts”

              Display “you picked the following numbers: ” +userGuesses

computer_guess() module

   Get number from user

   count=1

   computerGuesses=[]

   while True

      Get randomval from computer

      computerGuesses.append(randomval)

      if (number<randomval)

         Display “Too low”

         count=count+1

      else if (number>randomval)

         Display “Too high”

         count=count+1

      else if (number==randomval)

         Display “The computer guessed it in “+ count + ” attempts. The number was “+randomval

         Display “The computer guessed the following numbers “+computerGuesses

      else

         break

When you run the program you should see the following:

Welcome to my Guess the number program!

You guess the number

You type a number and see if the computer can guess it

Exit

What is your choice: 1

Please guess a number between 1 and 10: 5

Too high

Please guess a number between 1 and 10: 4

Too high

Please guess a number between 1 and 10: 3

Too high

Please guess a number between 1 and 10: 2

Too high

Please guess a number between 1 and 10: 1

You guessed it! It took you 5 attempts

You picked the following numbers: [5, 4, 3, 2, 1]

You guess the number

You type a number and see if the computer can guess it

Exit

What is your choice: 2

Please enter a number between 1 and 10 for the computer to guess: 5

The computer guessed 8 which is too high

The computer guessed 7 which is too high

The computer guessed 4 which is too low

The computer guessed 7 which is too high

The computer guessed 4 which is too low

The computer guessed 7 which is too high

The computer guessed 2 which is too low

The computer guessed 1 which is too low

The computer guessed 7 which is too high

The computer guessed 6 which is too high

The computer guessed 3 which is too low

The computer guessed it! It took 12 attempts

The computer guessed the following numbers: [8, 7, 4, 7, 4, 7, 2, 1, 7, 6, 3, 5]

You guess the number

You type a number and see if the computer can guess it

Exit

What is your choice: 3

Thank you for playing the guess the number game!

 

CIS115 Programming Logic and Design

Week 8 Course Project    

This week we will create a powerpoint presentation illustrating your Guess the Number game course project. You will create a narrated powerpoint presentation.  A video explanation on how to create a narrated powerpoint is here (Links to an external site.).  In addition, add one new feature to your Guess the number game. Feel free to add any new feature. Some ideas include:

Smarter computer guessing (if it is too high, the computer will decrease its guess by 1 or too low increase its guess by 1)

A limited number of guesses (for example – only 5 guesses)

Asking the user for his/her name and greeting the user by name

A 2 player option where one person enters a number and the other person tries to guess it

A GUI (watching the video for the powerpoint narration, the video author explains how to create a GUI in python

Submit your narrated powerpoint and final .py code with screenshot

 

Having Trouble Meeting Your Deadline?

Get your assignment on CIS115 Full Course Project Latest 2020 December completed on time. avoid delay and – ORDER NOW

Dot Image

Order Solution Now

Similar Posts