Declare a variable and assign an integer value to it. Also, print it to the
console.
Write a C++ program that displays the row numbers of a matrix containing at least two prime numbers. First, the program should create a 2D array (5 rows, 5 columns). Then, ask the user to input values in the matrix or 2D array. After that, program should display row number (or index) which has at least two prime numbers. If no row (of the matrix) contains at least two prime numbers then the program should display the message “No row found containing two prime numbers”.
Answers the question below:
1. What do you call the 1st array/index in two dimensional array?
2. What do you call the 2nd array/index in two dimensional array?
3. What is the output of the given code?
double[] sales = {12.5, 32.50, 16.90, 23, 45.68,
9, 10.5};
for(int i=0; i<sales.length; i++)
{ } System.out.print(sales.length);
4. What is the output of the given code?
double[][] sales = {
{12.5, 32.50}, (16.90, 23, 45.68}, {1, 2, 3, 4),
};
System.out.print(sales[2][1]);
5. What is the output of the given code?
double[][] sales = {
(12.5, 32.50), (16.90, 23, 45.68}, {1, 2, 3, 4),
}; System.out.print(sales[1][1]);
Write a program that mimics a calculator. The program should take as input two integers and the operation
to be performed.
It should then output the numbers, the operator, and the result. (For division, if the denominator is zero,
output an appropriate message.)
Some sample outputs are as follow:
3 + 4 = 7
13 * 5 = 65
def mystery1(x):
return x + 2
def mystery2(a, b = 7):
return a + b
#MAIN
n = int(input("Enter a number:"))
ans = mystery1(n) * 2 + mystery2 (n * 3)
print(ans)
What is output when the user enters 3?
create a mechanism that hides information in the form of a cryptogram or cypher.
Requirements
1. Write a complete C++ application to prompt the user for the double voltage and resistance of a circuit, and call function calcurrent to calculate and display the current of the circuit.
Use the following statement to calculate the current:
double current = voltage / resistance
2. Write a C++ program to calculate the product of all even numbers from 1 to 13 using a for loop.
3. Write a C++ Program to generate a random from the following list of numbers
Put the above statements in a C++ program and run the program and print the generated numbers
ProblemStatement:
This exercise needs to be submitted through the Visual Studio Package: Day2->Assignment2
A corporate bank ’IEBI’ needs to automate the process of transferring the money.
Class Diagram:
Account (long, double) method:
Account (long, double, string [], long []) method:
DebitAmount(amount) method:
Write a program that takes length as input in feet and inches and convert it into centimeters. Using the constant for declaration of conversion constants. To calculate the equivalent length in centimeters, you need to multiply the total inches by 2.54. Similarly, to find the total inches, you need to multiply the feet by 12 and add the inches.
Write a program that takes length as input in feet and inches and convert it into centimeters. Using the constant for declaration of conversion constants. To calculate the equivalent length in centimeters, you need to multiply the total inches by 2.54. Similarly, to find the total inches, you need to multiply the feet by 12 and add the inches.