The purpose of this lab assignment is to demonstrate knowledge of selection statements and looping structures

You are going to write a series of small individual programs.

Problem 1

Create a program that will print all odd integers from 1 up to a given value entered by the user.

Problem 2

Write a program that will print out all the Fibonacci numbers up to a certain number of digits. Your program should input the number of Fibonacci numbers to be displayed and display those values. For example if 8 was input it should display 1 1 2 3 5 8 13 21

Problem 3

Write a program that will allow us to sum all the integers from 1 up to a given number. The program will prompt for and allow input for an integer. It will then calculate and display the sum of all integers from 1 to that value.

Problem 4

Create a program that can be used to practice simple multiplication problems. The program should randomly generate 2 single digit numbers for the user to multiply and display it in the form of a problem. The user should enter an answer to the problem and it should check if they got it right or wrong. The program will continue asking until the user gets 3 correct answers.

Problem 5

Write a program that will allow us to enter a specific number of integers into the console and determine the smallest of all those values. The program will first prompt you for how many values you'd like to enter. It will then ask you for that many values and finally print the smallest of all the values entered

Problem 6

Write a program that will create the following diagram.

*
**
***
****
*****

Problem 7

Write a program that will produce the same style of diagram in problem 6, but it will get user input for the number or rows of stars (*) that you would like to see. Thus if I input 7 for the number of rows it will print 7 rows of stars following the same pattern as seen in problem 6

Problem 8

Create a set of nested for loops that will print out all the prime numbers from 2-100. A prime number is any number that is only divisible by 1 and itself.

Problem 9

Write a program that will produce a checkerboard pattern of x's and o's. It should allow you to input the number of rows for the checkerboard and then produce a square matrix of alternating x's and o's in the following manner:

x o x o x
o x o x o
x o x o x
o x o x o
x o x o x

Problem 10

Create a program that will allow me to enter a specific percentage and it will display if that grade was and A, B, C, D, or F. Use proper rounding rules in your definition of the grade (ie 89.5 should be an A). There is no repetition in this example

Problems 11

The program should perform the same process as problem 10 but it should repeat the process until a sentinel value is entered. The sentinel is your choice but it must be made aware to the user when running the program.

Problem 12

The program should calculate the sum of all the digits of a number entered by the user. For example if the user enters 243 it should display the sum of the digits as 9

Problem 13

Write a program that will calculate the average of a set of test scores. The program will continue to ask for test scores until a -1 is entered by the user. Once a -1 is entered it should display the average of all previously entered test scores.

Problem 14

Write a program that will determine if a number is a perfect number. A perfect number is one where all of the factors of the value other than itself sum to the value again. For example 6 is a perfect number because the factors of 6 (not including itself) 1, 2, 3 all sum to 6 (1+2+36). 12 is not a perfect number because 1+2+3+4+6!= 12.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.