The document outlines 4 exercises for a programming homework assignment. The first exercise asks students to write a program that takes in two integer numbers and an operator from the user and prints the result. The second exercise asks students to write a program to find the roots of a quadratic equation. The third exercise asks students to write a prime number checking program. The fourth exercise asks students to write a number guessing game that randomly generates a number between 1 and 100 for the user to guess within 7 chances. Sample code and test outputs are requested to be included for each exercise.
The document outlines 4 exercises for a programming homework assignment. The first exercise asks students to write a program that takes in two integer numbers and an operator from the user and prints the result. The second exercise asks students to write a program to find the roots of a quadratic equation. The third exercise asks students to write a prime number checking program. The fourth exercise asks students to write a number guessing game that randomly generates a number between 1 and 100 for the user to guess within 7 chances. Sample code and test outputs are requested to be included for each exercise.
The document outlines 4 exercises for a programming homework assignment. The first exercise asks students to write a program that takes in two integer numbers and an operator from the user and prints the result. The second exercise asks students to write a program to find the roots of a quadratic equation. The third exercise asks students to write a prime number checking program. The fourth exercise asks students to write a number guessing game that randomly generates a number between 1 and 100 for the user to guess within 7 chances. Sample code and test outputs are requested to be included for each exercise.
CLASS: 20MC Link download: sovainoiii/buoi1 (github.com) EXERCISE 1: Write a program with the following requirements: Enter two integer numbers a and b; one operator (+-*/) from the keyboard. Print the result of the expression: a (+-*/) b - Explain the program + code: + Khai báo biến a, b, pheptinh + Nhập từ bàn phím và kiểm tra nếu nhập không đúng định dạng là số thì sẽ nhập lại + Nhập từ bàn phím phép tính ( +-*/ ) nếu không đúng sẽ thông báo không đúng định dạng.
- Pictures of the running programs (test):
EXERCISE 2: Write a program to find Roots of Quadratic Equation: ax2 + bx +c = 0 - Explain the program + code: - Pictures of the running programs (test): EXERCISE 3: Prime Number Program in C#, we will take an input n from the user; the program will ask the user to reenter n if n>2 and check whether the number is prime or not. - Explain the program + code:
- Pictures of the running programs (test):
EXCERCISE 4: Write a program to create A Number Guessing Game with the following requirements: The program begins by randomly generating a number between 1 and 100. The Game prompts a user to input a number. The random number is the winning number used to compare against the user’s guessing number. The Game will give a user 7 chances for the user to guess a randomly generated. number. If the user guesses wrong, the program will announce the number guessed is smaller or bigger than the winning number.