Skip to main content
EDU-MMCS
You are currently using guest access (Log in)

CS211 C++, Programming languages

  1. Home
  2. Courses
  3. Осенний семестр
  4. Фундаментальная информатика и ИТ
  5. CS211 C++ ENG
  6. Module 1. Introduction
  7. Test 1

Test 1

Completion requirements
Opened: Monday, 7 October 2024, 11:55 AM
Due: Monday, 7 October 2024, 1:35 PM

You have two tasks to do. Your teacher will give you your personal test number .

Upload your files here after completing tasks.

Student 1

Task 1.

To do: The price of 1 kg of sweets is entered (an integer number). Create a function with one argument to print the cost of 1.2, 1.4,…, 2 kg of sweets. Use for loop.

Note: the signature of the function:

void printPrice(int price)
       {
             // …
       }

Expected output:

Please, enter the price of 1 kg:  
>>>63
Result:
75.6   88.2   100.8   113.4   126

Task 2.

To do: Create a function to calculate a multiplication of even integers in the interval [10;20] (10 * 12 * 14 * 16 * 18 * 20). Make the task using a while loop. Create a multi-file project to solve the task: main.cpp, implementation.cpp, header.h.

Note: The signature of the function must be: 

void findMult(int & a, int & b){

…

}

where a = 10 and b = 20

Expected output:

Result:
9676800 

Student 2

Task 1.

To do: The price of 1 kg of sweets is entered (an integer number). Create a function with one argument to print the cost of 1, 2, 3…, 10 kg of sweets. Use for loop.

Note: the signature of the function:

void printPrice(int price)
       {
             // …
       }

Expected output:

Please, enter the price of 1 kg: 

>>>63
Result:
63   126   189   252   315   378   441   504   567   630

Task 2.

To do: Create a function to calculate a sum of odd integers in the interval [21;33] (21 + 23 + 25 + 27 + 29 + 31). Make the task using a while loop. Create a multi-file project to solve the task: main.cpp, implementation.cpp, header.h.

Note: The signature of the function must be: 

void findSum(int & a, int & b){

…

}

where a = 21 and b = 33

Expected output:

Result:
157  

Student 3

Task 1.

To do: Two integers A and B are entered (A<B). Create a function with two arguments to  print the squares of all integers between A and B in ascending order and including these numbers themselves. Use for loop.

Note: the signature of the function:

void printSquares(int a, int b)
       {
             // …
       }

Expected output:

Please, enter two numbers A and B:  
>>> 4  >>> 13
Result:
16  25  36  49  64  81  100  121  144  169

 Task 2.

To do: Create a function to calculate a sum of integers in the interval [-5;10] with a step=3 (-5 + -2 + 1 + 4 + 7 + 10). Make the task using a while loop. Create a multi-file project to solve the task: main.cpp, implementation.cpp, header.h.

Note: The signature of the function must be: 

void findSum(int & a, int & b){

…

}

where a = -5 and b = 10

Expected output:

Result:
15 

Student 4

Task 1.

To do: Two integers A and B are entered (A<B). Create a function to calculate a value of the function z(x) = 2x-2 for all x varying on the interval [A, B]. Use for loop.

Note: the signature of the function:

void printFunc(int a, int b)
       {
             // …
       }

Expected output:

Please, enter two numbers A and B:  
>>> 3  >>> 14
Result:
4  6  8  10  12  14  16  18  20  22  24  26

 Task 2.

To do: Create a function to calculate a multiplication of integers in the interval [-5;7] with a step=3 (-5 * -2 * 1 * 4 * 7 ). Make the task using a while loop. Create a multi-file project to solve the task: main.cpp, implementation.cpp, header.h.

Note: The signature of the function must be: 

void findMult(int & a, int & b){

…

}

where a = -5 and b = 7

Expected output:

Result:
280  

◄ Lesson # 4. Enumerations
Lesson # 5. Using arrays and vectors ►
Skip Navigation
Navigation
  • Home

    • Site pages

      • My courses

      • Tags

    • My courses

    • Courses

      • Осенний семестр

        • Прикладная математика и информатика

        • Фундаментальная информатика и ИТ

          • Compiler Development

          • CMVSM

          • АЗПК

          • Frontend

          • ТеорЯП

          • Ruby Eng

          • EngCA&OS

          • CS201e

          • Компиляторы - лекции

          • CS202

          • CS211 C++ ENG

            • General

            • Module 1. Introduction

              • AssignmentLesson # 1. Console application. Basic constructio...

              • AssignmentLesson # 2. Functions/Methods

              • AssignmentLesson # 3. Arguments by Reference

              • AssignmentLesson # 4. Enumerations

              • AssignmentTest 1

              • AssignmentLesson # 5. Using arrays and vectors

              • AssignmentLesson # 6. Using strings

              • AssignmentLesson # 7. Pointers basics

              • AssignmentLesson # 8. Dynamic memory. Arrays of pointers

            • Module 2. Object-oriented programming

            • Recursion

            • Topic 4

            • Topic 5

            • Topic 6

            • Topic 7

            • Topic 8

            • Topic 9

            • Topic 10

        • Математика, механика

        • Педагогическое образование

        • Магистратура

          • Разработка мобильных приложений и компьютерных игр

        • Аспирантура

        • Вечернее отделение

        • Другое

      • Весенний семестр

        • Прикладная математика и информатика

        • Фундаментальная информатика и ИТ

        • Математика, механика

        • Педагогическое образование

        • Магистратура

          • Разработка мобильных приложений и компьютерных игр

        • Аспирантура

        • Вечернее отделение

        • Другое

      • Воскресная компьютерная школа

        • Пользователь компьютера плюс

        • Пользователь прикладных программ

        • Программирование I ступень

        • Программирование II ступень

        • Программирование III ступень

        • Архив

      • Воскресная математическая школа

        • Открытое тестирование РНОМЦ и мехмата ЮФУ - 2025

        • Олимпиадная математическая школа

        • Повышение квалификации

        • Доступная математика

        • Лаборатория математического онлайн-образования мех...

        • Осенняя универсиада

        • Научно-практическая конференция

        • ВМШ

          • ВМШ - 24

        • Летняя олимпиадная математическая школа РНОМЦ и ме...

      • Государственная итоговая аттестация

      • Дополнительное образование

      • Олимпиады

      • Видеолекции

      • Разное

      • Архив курсов

      • Заочная школа мехмата ЮФУ

Contact site support
You are currently using guest access (Log in)
CS211 C++ ENG
Data retention summary
Get the mobile app Яндекс.Метрика