num1 = as.integer(readline(prompt = "Enter 1st number: "))
num2 = as.integer(readline(prompt = "Enter 2nd number: "))
result = num1 + num2
print(paste(result))
using R programming language, make a simple addition program that will allow input (any number) from...
Using the programming language C, read user input of an integer, check and output whether the integer is an odd number or even number.
It is required to write a Matrix Calculator Program using C Programming Language that could only perform addition, subtraction, and multiplication of two matrices of appropriate dimensions. Your program should prompt the user to select a matrix operation from a list of options that contains the aforementioned operations. Then, the user should be prompted to enter the dimensions of the two operand matrices. Next, your program should prompt the user to enter the elements of each matrix row-wise. Your program...
JAVA PROGRAMMING LANGUAGE
SAMPLE INPUT & OUTPUT
3.25
1 1/4
9/4
0
Case #1:
3.25
13/4
3 1/4
Case #2:
1.25
5/4
1 1/4
Case #3:
2.25
9/4
2 1/4
Make a class named fraction. And make a program that accepts inputs from a user and creates outputs from those inputs. User can input in any of these forms: - - - A fraction that can be a proper fraction or an improper fraction. A mixed fraction. Or a decimal...
C++ Programming: Using Conditions Hello, can anyone create a C++ program that will allow me to ask the user to supply the current total and the quantity of the hardware purchased. This program should calculate the grand total based on the number of units purchased as shown in the chart below: Amount of Hardware Discount Received 10-19 20% 20-49 30% 50-99 40% 100 or more 50% Also, make sure to certify what happens when the user enter 0 or less...
Using PYTHON create a program to allow the user to enter a phrase or read a file. Make your program menu-driven to allow the user to select a option to count the total words in the phrase or file. In addition, provide a menu-selection to count the number of words start with a vowel and a selection to count the number of words that start with a consonant. Include exception handlers for file not found, divide by zero, and index...
THE PROGRAMMING LANGUAGE IS C++ Part 1.Create a program that decides whether a given integer is prime or not. The program should at the end of its analysis print the number followed by prime or composite. Part 2.Make the program from part 1 print the prime factors of any composite number entered (an additional feature to Part 1). THE PROGRAMMING LANGUAGE IS C++
Using C++ programming. Write a program that takes a string of input from the user and separates the string of words based on the premise that the string contains words whose first letter is uppercase. Then, display the phrase (or sentence) to a string in which the words are separated by spaces and only the first word of the phrase starts with an uppercase letter. For example, if the user enters "IAmTheTeacher", then the program would display: "I am the...
Programming language: PYTHON Prompt: You will be creating a program to show final investment amounts from a principal using simple or compound interest. First, get a principal amount from the user. Next, ask the user if simple or compound interest should be used. If the user types in anything other than these options, ask again until a correct option is chosen. Ask the user to type in the interest rate as a percentage from 0 to 100%. Finally, ask the...
Using your programming language of choice, write a program that will ask for: Probability of A Probability of B Probability of B given A and will then output the probability of A given B using Bayes Theorem. You can prompt for input anyway you like (command line, GUI, website, etc), and return the result any way you like (command line, GUI, website, etc).
Question is two parts In R(Programming language). Define and write a function which takes one number as input and detects whether the number is even. Return TRUE if it is even, and FALSE otherwise. You need to first detect if the input is an integer; if not, return NA. Note 1: TRUE and FALSE are logical values, not strings! Note 2: No need to get user input from the console. Test your function using your_function_name(1), your_function_name(2), and your_function_name(1.5). Hint: What...