Guess The Number: The user needs to guess what that number is. If the user’s guess is wrong, the program should return some sort of indication as to how wrong (e.g. The number is too high or too low). If the user guesses correctly, a positive indication should appear.
1001: Read 2 integer values and store them in variables A and B. Sum A and B by assigning your result to variable X. Print X as shown below.
Cicle Area: The formula for calculating the area of a circle is: area = π. radius 2. Considering for this problem that π = 3.14159:
Simple Sum: Read two integer values, in this case for variables A and B. Then, calculate the sum between them and assign to the variable SUM. Then write the value of this variable.
Simple Product: Read two integer values. Next, calculate the product between these two values and assign this operation to the PROD variable. Then show the PROD variable with corresponding message.
Average 1: Read 2 double-precision floating point values A and B, which correspond to 2 grades of a student. Next, calculate the student's average, knowing that grade A has a weight of 3.5 and grade B has a weight of 7.5 (The sum of the weights is therefore 11). Assume that each note can go from 0 to 10.0, always with one decimal place.
Average 2: Read 3 values, in this case, variables A, B and C, which are the three grades of a student. Next, calculate the student's average, knowing that grade A has weight 2, grade B has weight 3 and grade C has weight 5. Consider that each grade can range from 0 to 10.0, always to one decimal place.
Difference: Read four integer values A, B, C and D. Next, calculate and show the difference of the product of A and B by the product of C and D according to the formula: DIFFERENCE = (A * B - C * D).
Salary: Write a program that reads an employee's number, his number of hours worked, the amount he receives per hour and calculates that employee's salary. Next, show the employee's number and salary, to two decimal places.
Salary With Bonus: Make a program that reads the name of a salesman, his fixed salary and the total sales made by him in the month (in cash). Knowing that this seller earns 15% commission on his sales made, inform the total receivable at the end of the month, with two decimal places.
Simple Calculation: In this problem, you should read the code of a part 1, the number of parts 1, the unit value of each part 1, the code of a part 2, the number of parts 2 and the unit value of each part 2. After , calculate and show the amount to be paid.
Sphere: Make a program that calculates and shows the volume of a sphere and the value of its radius (R) is given. The formula for calculating the volume is: (4/3) * pi * R3. Consider (assign) to pi the value 3.14159. Tip: When using the formula, try to use (4 / 3.0) or (4.0 / 3), because some languages (among them C ++), assume that the result of the division between two integers is another integer.
Area: Write a program that reads three double-precision floating point values: A, B and C. Then, calculate and show: a) the area of the right triangle with A as the base and C as the height. b) the area of the circle of radius C. (pi = 3.14159) c) the area of the trapezoid that has A and B for bases and C for height. d) the area of the square with side B. e) the area of the rectangle that has sides A and B.
The Biggest: Make a program that reads three values and displays the largest of the three values read in a row.
Consumption: Calculate the average consumption of a car by supplying the total distance traveled (in km) and the total fuel spent (in liters).
Distance Between Two Points: Read the four values corresponding to the x and y axes of any two points in the plane, p1 (x1, y1) and p2 (x2, y2) and calculate the distance between them, showing 4 decimal places after the comma.
Distance: Two cars (X and Y) leave in the same direction. Car X leaves at a constant speed of 60 km / h and car Y leaves at a constant speed of 90 km / h. In one hour (60 minutes), car Y is able to distance itself 30 kilometers from car X, that is, it is able to move one kilometer away every 2 minutes. Read the distance (in Km) and calculate how long it takes (in minutes) for car Y to take that distance from the other car.
Fuel: Joãozinho wants to calculate and show the amount of liters of fuel spent on a trip, when using a car that does 12 KM / L. For this, I would like you to attend to it through a simple program. To perform the calculation, the time spent on the trip (in hours) and the average speed during the trip (in km / h) must be reported. Thus, one can obtain the distance covered and calculate how many liters would be needed. Show the value to 3 decimal places after the period.
Banknotes: Read an integer value. Next, calculate the smallest possible number of notes (banknotes) into which the value can be broken down. The notes considered are 100, 50, 20, 10, 5, 2 and 1. Next, show the value read and the list of necessary notes.
Time Conversion: Read an integer value, which is the duration in seconds of a given event in a factory, and enter it in the format hours: minutes: seconds.
Age in Days: Read an integer corresponding to a person's age in days and enter it in years, months and days. Note: just to facilitate the calculation, consider every year with 365 days and every month with 30 days. In test cases there will never be a situation that allows 12 months and some days, such as 360, 363 or 364. This is just an exercise with the aim of testing simple mathematical reasoning.
Banknotes and Coins: Read a floating point value to two decimal places. This value represents a monetary value. Next, calculate the smallest number of notes and coins possible into which the value can be broken down. The notes considered are 100, 50, 20, 10, 5, 2. The possible currencies are 1, 0.50, 0.25, 0.10, 0.05 and 0.01. Then show the list of notes required.
Selection Test: Read 4 integer values A, B, C and D. Next, if B is greater than C and if D is greater than A, and the sum of C with D is greater than the sum of A and B and if C and D, both are positive and if variable A is to write the message "Values accepted", otherwise write "Values not accepted".
Bhaskara: Read 3 floating point values and calculate the roots of the Bhaskara equation. If it is not possible to calculate the roots, display the corresponding message “Impossible to calculate”, in case there is a division by 0 or negative number root.
Interval: You must make a program that reads any value and presents a message saying in which of the following intervals ([0.25], (25.50], (50.75], (75.100]) this value is found. the value is not in any of these ranges, the message “Out of range” should be printed. The symbol (represents "greater than". For example: [0.25] indicates values between 0 and 25.0000, including them. (25.50] indicates values greater than 25 Ex: 25.00001 up to the value 50.0000000.
Snack:
Average 3: Read four numbers (N1, N2, N3, N4), each with one decimal place, corresponding to a student's four grades. Calculate the average with weights 2, 3, 4 and 1, respectively, for each of these notes and show this average accompanied by the message "Media:". If this average is greater than or equal to 7.0, print the message "Student approved.". If the calculated average is less than 5.0, print the message "Student failed." If the calculated average is between 5.0 and 6.9, including these, the program should print the message "Student in exam.". In case the student is in exam, read a value corresponding to the exam score obtained by the student. Then print the message "Examination note:" accompanied by the note entered. Recalculate the average (add the exam score to the average previously calculated and divide by 2). and print the message "Student approved." (if the final grade is 5.0 or more) or "Student failing.", (if the grade is 4.9 or less). For these two cases (pass or fail after taking the exam), present in the last line a message "Final media:" followed by the final average for that student.
Coordinates of a Point: Read 2 values with one decimal place (x and y), which must represent the coordinates of a point on a plane. Next, determine which quadrant the point belongs to, or whether it is on one of the Cartesian axes or at the origin (x = y = 0).
Simple Sort: Read 3 whole values and sort them in ascending order. At the end, show the values in ascending order, a blank line and then the values in the sequence as they were read.
Triangle: Read 3 real values (A, B and C) and check whether they form a triangle or not. If so, calculate the triangle's perimeter and display the message: Perimeter = XX.X If not, calculate the area of the trapezoid that has A and B as the base and C as the height, showing the message: Area = XX.X
Multiples: Read 2 integer values (A and B). Afterwards, the program should show a message "Are Multiples" or "Not Multiples", indicating if the values read are multiple with each other.
Types of Triangles: Read 3 floating point values A, B and C and order them in descending order, so that side A represents the largest of the 3 sides. Next, determine the type of triangle these three sides form, based on the following cases, always writing an appropriate message: if A ≥ B + C, display the message: NAO FORMMA TRIANGULO if A2 = B2 + C2, present the message: TRIANGULO RECTANGULO if A2> B2 + C2, present the message: TRIANGULO OBTUSANGULO if A2 <B2 + C2, present the message: TRIANGULO ACUTANGULO if the three sides are equal, present the message: TRIANGULO EQUILATERO if only two sides are equal, present the message: TRIANGULO ISOSCELES
Game Time: Read the start and end times of a game. Then calculate the duration of the game, knowing that it can start on one day and end on another, with a minimum duration of 1 hour and a maximum of 24 hours.
Game Time With Minutes: Read the start time, start minute, end time and end minute of a game. Then calculate the duration of the game. Note: The game has a minimum duration of one (1) minute and a maximum duration of 24 hours.
Salary Increase:
Animal:
DDD: Leia um número inteiro que representa um código de DDD para discagem interurbana. Em seguida, informe à qual cidade o DDD pertence.
Income Tax: In an imaginary country called Lisarb, all inhabitants are happy to pay their taxes, as they know that there are no corrupt politicians and the funds raised are used for the benefit of the population, without any deviation. The currency of this country is Rombus, whose symbol is R$. Read a value to two decimal places, equivalent to the salary of a person from Lisarb. Then calculate and show the amount that this person must pay Income Tax.
Month: Read an integer between 1 and 12, inclusive. Corresponding to this value, the month of the year must be presented in full, in English, with the first letter in uppercase.
Even Numbers: Make a program that shows even numbers between 1 and 100, inclusive.
Positive Numbers: Make a program that reads 6 values. These values will only be negative or positive (disregard the null values). Next, show the number of positive values entered.
Event Time: Pedrinho is organizing an event at his University. The event should take place in April, starting and ending within the month. The problem is that Pedrinho wants to calculate how long the event will last, since he knows when it starts and when the event ends. Knowing that the event can last from a few seconds to several days, you should help Pedrinho to calculate the duration of this event.
Positives and Average: Read 6 values. Then, show how many of these values entered were positive. In the next line, the average of all the positive values entered must be shown, with one digit after the decimal point.
Even Numbers 2: Make a program that reads 5 integer values. Count how many of these entered values are even and show this information.
Even, Odd, Positive, Negative: Read 5 Integer values. Then show how many entered values were even, how many entered values were odd, how many entered values were positive and how many entered values were negative.
Odd Numbers: Read an integer value X (1 <= X <= 1000). Then show the odd numbers from 1 to X, one value per line, including X, if applicable.
Odd Numbers 2: Read an integer value X. Then display the 6 consecutive odd values starting from X, one value per line, including X if applicable.
Consecutives Odd Numbers: Read 2 integer values X and Y. Next, calculate and show the sum of the odd numbers between them.
Interval 2: Read an integer N. This value will be the amount of integer X values that will be read next. Show how many of these X values are within the range [10.20] and how many are outside the range, showing this information.
Pairs Square: Read an integer value N. Display the square of each of the even values, from 1 to N, including N, if applicable.
Even or Odd: Read an integer N. This value will be the number of values that will be read next. For each value read, show a message in English saying if this value read is even (EVEN), odd (ODD), positive (POSITIVE) or negative (NEGATIVE). In case the value is equal to zero (0), although the correct description is (EVEN NULL), because by definition zero is even, your program should print only NULL.
Remainder: Read an integer value N. Display all numbers between 1 and 10000 that divided by N give remainder equal to 2.
Multiplication Table: Read 1 integer value N (2 < N <1000). Next, show the N multiplication table: 1 x N = N 2 x N = 2N ... 10 x N = 10N