Write a function named "reduce" that takes two positive integer arguments, call them "num" and "demon", treats them as the numerator and denominator of a fraction, and reduces the fraction. That is to say, each of the two argument will be modified by dividing it by the greatest common divisor of the two integer. The function should return the value 0(to indicate the failure reduce) if either of the two argument is zero or negative and should return the value 1 otherwise.
Create a class named 'Student' with a string variable 'name' and an integer variable
'roll_no'. Assign the value of roll_no as '2' and that of name as "John" by creating an
object of the class Student.
Write a C++ program that will find maximum number in an array.
2.Assign and print the roll number, phone number and address of two students having
names "Sam" and "John" respectively by creating two objects of the class 'Student'.
Write a program to do the following tak
Four Strings are accepted through command line arguments.
Each string is passed to a function inPalindrome) that checks whether the string is a palindume or net and retums true or falser accordingly
If the string is a palindroene it is stored in a text file named "Palindrome.txt"
and print a user friendly message on console also
Design a class art that contain the details of artist, country and class info contain the details of year and art-tyoe(fancy, historic or modern) . Use a function for displaying the details by reading data from class art and info. The function used for displaying is not a member of any class.
The learners must create a C++ program using FUNCTIONS to compute the net salary of the employee based on the status. The program will allow the users to choose the status and using the functions, the program will ask the values needed to compute the net salary. There must be two functions to compute the net salary for Contractual and Regular. Please use contractual and regular as FUNCTION NAMES.
Intro Message:
This program tests if a triangle is valid by adding up the three angles.
Prompts and Input:
Enter the measurement of the first angle: [user types: 50]
Enter the measurement of the second angle: [user types: 100]
Enter the measurement of the third angle: [user types: 30]
Output 1 (User types three numbers that DO add up to 180):
This is a valid triangle!
Would you like to run the program again (Y or N)? n
Output 2 (User types three numbers that do NOT add up to 180 and wants to try again):
This is an invalid triangle. Angles must add up to 180 degrees.
Would you like to run the program again (Y or N)? y
[* Repeat the Prompts and Input section *]
Write a program that will ask the user to enter the Atomic Number of an element and check if it is a precious metal according to the list below:
Atomic Number 47: Silver
Atomic Number 78: Platinum
Atomic Number 79: Gold
Output Possibility #1 (One of the three precious metals):
Enter an atomic number to see if it is a precious metal: [user types: 47]
47 is the atomic number for Silver
Output Possibility #2 (NOT a precious metal):
Enter an atomic number to see if it is a precious metal: [user types: 50]
50 is not an atomic number for a precious metal
This program will write a series of letters, starting with 'A', to an external file (letters.txt). The user will decide how many letters in total get saved to the file.
** IMPORTANT: The test cases will evaluate your code against .txt files that I uploaded. You do NOT have to upload your own txt files.
Input:
Including 'A', how many total letters would you like to store? [user types: 26]
Output (in the file, not in the console window)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z