Category Archives: Labs

Lab 8

In-class:

  • In a program, you need to store the populations of 5 countries.
  • Define a two-dimensional array to store the code of the countries and their populations. Assume these values are both are integers.
  • Write a loop that uses this array to print each country’s code and its population.
  • Due TODAY before the end of the class.

Homework:

  • Log into your CodeStepByStep account.
  • Complete the Lab 8 exercises
  • Deadline: An hour before the beginning of next class.

To practice more problems please visit:

https://www.codestepbystep.com/problem/list/cpp

Lab 7

In-class:

  • Larger than n: In a program, write a function that accepts three arguments: an array, the size of the array, and a number n. Assume the array contains integers. The function should display all of the numbers in the array that are greater than the number n. Make the program interactive so the user can enter the value of n.
  • Due TODAY before the end of the class.

Homework:

  • Log into your CodeStepByStep account.
  • Complete the Lab 7 exercises
  • Deadline: An hour before the beginning of next class.

To practice more problems please visit:

https://www.codestepbystep.com/problem/list/cpp

Lab 6

In-class:

  • Write a program to store exam scores into a file. The program will ask the user how many exam scores to enter. Then it will ask the user for each exam score and store them in a file called scores.dat
  • The file output should have the following format:
    • Exam 1: 97
    • Exam 2: 85
  • Due TODAY before the end of the class.

Homework:

  • Log into your CodeStepByStep account.
  • Complete the Lab 6 exercises
  • Deadline: An hour before the beginning of next class.

To practice more problems please visit:

https://www.codestepbystep.com/problem/list/cpp

Lab 5

In-class:

  • Write a program with the following functions:
    • toCelsius that converts temperature from Fahrenheit to Celsius. The conversion formula from Fahrenheit to Celsius is F is the Fahrenheit temperature, and C is the Celsius temperature. The function will return the converted temperature.
    • toFahrenheit that converts temperature from Celsius to Fahrenheit . The conversion formula is F is the Fahrenheit temperature, and C is the Celsius temperature. The function will return the converted temperature.
  • The program will show a menu to the user asking what temperature to convert. Then it will show the temperature of the first 100 degrees converted from one temperature to the other by calling the appropriate function.
  • You must use function prototypes in your code as well as the appropriate decision and loop statements.
  • Due TODAY before the end of the class.

Homework:

  • Log into your CodeStepByStep account.
  • Complete the Lab 5 exercises
  • Deadline: An hour before the beginning of next class.

To practice more problems please visit:

https://www.codestepbystep.com/problem/list/cpp

Lab 4

Project:

  • Start researching the Raspberry Pi device and how to use
  • Brainstorm possible project using C/C++ on the Raspberry Pi

In-class:

  • Write a program with the following functions:
    • toCelsius that converts temperature from Fahrenheit to Celsius. The conversion formula from Fahrenheit to Celsius is F is the Fahrenheit temperature, and C is the Celsius temperature. The function will return the converted temperature.
    • toFahrenheit that converts temperature from Celsius to Fahrenheit . The conversion formula is F is the Fahrenheit temperature, and C is the Celsius temperature. The function will return the converted temperature.
  • The program will show a menu to the user and what temperature they want to convert. Then it will ask the temperature, call the appropriate function, and display the results.
  • You must use function prototypes in your code as well as the appropriate decision statements.
  • Due TODAY before the end of the class.

Homework:

  • Log into your CodeStepByStep account.
  • Complete the Lab 4 exercises
  • Deadline: An hour before the beginning of next class.

To practice more problems please visit:

https://www.codestepbystep.com/problem/list/cpp

Lab 3

In-class :

  • Write a program with the following functions:
    • toCelsius that converts temperature from Fahrenheit to Celsius. The conversion formula from Fahrenheit to Celsius is F is the Fahrenheit temperature, and C is the Celsius temperature. The function will accept a double as input and return the converted temperature as a double. This function must also be overloaded to support integer input.
    • toFahrenheit that converts temperature from Celsius to Fahrenheit . The conversion formula is F is the Fahrenheit temperature, and C is the Celsius temperature. The function will return the converted temperature. The function will accept a double as input and return the converted temperature as a double. This function must also be overloaded to support integer input.
  • Write code to ask the user for the temperature and call the appropriate function to convert it. Make sure you test all 4 functions with the appropriate data types.
  • You must use function prototypes in your code.
  • Due TODAY before the end of the class.

Homework:

  • Log into your CodeStepByStep account.
  • Complete the Lab 3 exercises
  • Deadline: An hour before the beginning of next class.

To practice more problems please visit:

https://www.codestepbystep.com/problem/list/cpp

Lab 2

In-class :

  • Write a program with a function celsius that converts temperature from Fahrenheit to Celsius. The conversion formula from Fahrenheit to Celsius is F is the Fahrenheit temperature, and C is the Celsius temperature.
  • The program will ask the user for the temperature in Fahrenheit, call the function celsius and display the corresponding temperature in Celsius.
  • You must use function prototypes in your code.
  • Due TODAY before the end of the class.

Homework:

  • Log into your CodeStepByStep account created in Lab 0.
  • Complete the Lab 2 exercises
  • Deadline: An hour before the beginning of next class.

To practice more problems please visit:

https://www.codestepbystep.com/problem/list/cpp

Lab 1

In-class:

  • Write a program that converts temperature from Celsius to Fahrenheit. The conversion formula is F is the Fahrenheit temperature, and C is the Celsius temperature. The program should ask the user for the temperature in Celsius and display the corresponding temperature in Fahrenheit.

Homework:

  • Log into your CodeStepByStep account created in Lab 0.
  • Complete the Lab 1 exercises
  • Deadline: An hour before the beginning of next class.

To practice more problems please visit:

https://www.codestepbystep.com/problem/list/cpp

Labs Grading Criteria

In-Class Labs will be graded as follows:

  • 5 points: If finished in-class on-time
  • 2 points: If attempted in-class but incomplete
  • 1 point: For incomplete problems from the previous lab, shown completed at the beginning of next class lab session.
  • 0 points: Otherwise

Homework Lab problems:

  • 1 point each
  • Due 1-hour before the beginning of next class