Вопрос задан 18.08.2018 в 08:40. Предмет Информатика. Спрашивает Майорова Пелагея.

Помогите!!! Практическое задание №7 Тема: Знакомство с языком Паскаль. 1. а) Набрать в редакторе

системы Турбо-Паскаль следующую программу: Program my; Var a,b,c,s:integer; Begin ReadLn(a); ReadLn(b); ReadLn(c); S:=a*b*c; WriteLn(S) End. б) Откомпилировать набранную программу и исправить ошибки. в) Запустить данную программу на выполнение и проверить правильность её работы для чисел 2, 4 и 6. г) Запустить данную программу на выполнение и проверить правильность её работы для чисел 1, 0 и -1. д) Запустить данную программу на выполнение и проверить правильность её работы для чисел -2, 3 и 10. 2. Написать программу, которая присваивает целой переменной A значение 10 и выводит это значение на экран. 3. Написать программу, которая запрашивает ввод целого числа в переменную B и выводит это число на экран. Проверить правильность работы программы на числах 1, -5, 256, 10455. 4. Написать программу, которая запрашивает ввод вещественного числа в перемен-ную C, умножает это число на 2 и выводит результат на экран. Проверить правильность работы программы на числах 2.5, -7.33, 0, 782.234. 5. Написать программу для ввода значения величины X целого типа, присваивания величине Y действительного типа значения 5.5, вычисления значения величины Z = X - Y и вывода значения величины Z. Протестировать программу для X=5.5, X=0, X=-10.2
0 0
Перейти к ответам

Ответы на вопрос

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Nurmamedova Emiliya.
На первое задание ответ письменно не дашь так что сорян ...... могу сказать что нажимаете F9 и вводите значение которые вам нужны

0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Task 1a: Writing a program in Turbo Pascal

To complete this task, you need to write a program in Turbo Pascal that reads three integers from the user and calculates their product. Here's the program you can write:

```pascal Program my; Var a, b, c, s: integer; Begin ReadLn(a); ReadLn(b); ReadLn(c); s := a * b * c; WriteLn(s); End. ```

Task 1b: Compiling the program

To compile the program you wrote in Turbo Pascal, you can follow these steps: 1. Open the Turbo Pascal IDE. 2. Create a new project and save it with a suitable name. 3. Copy and paste the program code into the editor. 4. Press the "Compile" button or use the shortcut key combination to compile the program.

If there are any errors in the program, the compiler will display them in the output window. You can then correct the errors and recompile the program.

Task 1c: Running the program with input values 2, 4, and 6

To test the correctness of the program, you can run it with the input values 2, 4, and 6. The program should read these values and calculate their product. The result should be displayed on the screen.

To run the program in Turbo Pascal, you can follow these steps: 1. Press the "Run" button or use the shortcut key combination to run the program. 2. Enter the input values 2, 4, and 6 when prompted. 3. The program will calculate the product and display the result on the screen.

Task 1d: Running the program with input values 1, 0, and -1

To further test the correctness of the program, you can run it with the input values 1, 0, and -1. The program should read these values and calculate their product. The result should be displayed on the screen.

To run the program in Turbo Pascal, you can follow the same steps as in Task 1c.

Task 1e: Running the program with input values -2, 3, and 10

To test the correctness of the program with different input values, you can run it with the input values -2, 3, and 10. The program should read these values and calculate their product. The result should be displayed on the screen.

To run the program in Turbo Pascal, you can follow the same steps as in Task 1c.

Task 2: Writing a program to assign and display a value

To complete this task, you need to write a program in Turbo Pascal that assigns the value 10 to an integer variable A and displays this value on the screen. Here's the program you can write:

```pascal Program assignValue; Var A: integer; Begin A := 10; WriteLn(A); End. ```

Task 3: Writing a program to input and display an integer

To complete this task, you need to write a program in Turbo Pascal that prompts the user to enter an integer and displays that number on the screen. Here's the program you can write:

```pascal Program inputInteger; Var B: integer; Begin WriteLn('Enter an integer:'); ReadLn(B); WriteLn('You entered:', B); End. ```

To test the program, you can run it with the input values 1, -5, 256, and 10455. The program should prompt you to enter an integer, and after you enter the number, it should display it on the screen.

Task 4: Writing a program to input, multiply, and display a real number

To complete this task, you need to write a program in Turbo Pascal that prompts the user to enter a real number, multiplies it by 2, and displays the result on the screen. Here's the program you can write:

```pascal Program multiplyReal; Var C: real; Begin WriteLn('Enter a real number:'); ReadLn(C); C := C * 2; WriteLn('Result:', C); End. ```

To test the program, you can run it with the input values 2.5, -7.33, 0, and 782.234. The program should prompt you to enter a real number, and after you enter the number, it should multiply it by 2 and display the result on the screen.

Task 5: Writing a program to calculate and display a value

To complete this task, you need to write a program in Turbo Pascal that assigns the value 5 to an integer variable X, assigns the value 5.5 to a real variable Y, calculates the value of Z as X - Y, and displays the value of Z on the screen. Here's the program you can write:

```pascal Program calculateValue; Var X: integer; Y: real; Z: real; Begin X := 5; Y := 5.5; Z := X - Y; WriteLn('Result:', Z); End. ```

To test the program, you can run it with the input values X = 5.5, X = 0, and X = -10.2. The program should assign the values to the variables, calculate the value of Z, and display it on the screen.

Please note that the above programs are written in Turbo Pascal and can be executed using the Turbo Pascal IDE or a compatible compiler.

0 0

Топ вопросов за вчера в категории Информатика

Последние заданные вопросы в категории Информатика

Задать вопрос