Writing a small program for Bank Management System.
In this program, we are using the concept of C++ class and object, following basic
operations are being performed:
• Deposit
• Withdraw
In this program, we have created a class Bank with the following member functions:
• Deposit() – It will ask for the amount to be added in available balance, and deposit
the amount.
• Withdrawal() – It will ask for the amount to be withdrawn from the available, will
also check the available balance, if balance is available, it will deduct the amount
from the available balance.
2. Three is a Crowd
by CodeChum Admin
This one’s pretty simple as well, but I hope you haven’t forgotten how to create a new line!
Instructions:
Input three random characters and make sure they are inputted on different lines.
Print out the three strings in order, each on a different line, using only 1 std::cout statement and newline characters (\n). An initial code with 1 std::cout is already provide for you. Don't add more std::cout's!
Input
Three lines containing a character on each.
A
B
C
Output
Three lines containing a character on each.
A
B
C
3. Input + Addition
by CodeChum Admin
Hopefully you haven't forgotten about your previous lesson, because you're going to need it for this one.
Instructions:
Input two integers (one per line) and make sure to store them in variables.
Add the two integers and print out their sum!
Input
Two lines containing an integer on each.
6
6
Output
A line containing the addition of the two inputted integers.
12
Code
4. Decimal x Decimal
by CodeChum Admin
Now that we're done with integers, we're moving on to decimals!
Instructions:
Input three decimal numbers in one line separated by spaces, and make sure to store them in different variables.
Multiply the 1st and 2nd decimal numbers, and store the product into a variable.
Then, divide the product of the 1st and 2nd decimal numbers with the 3rd decimal number, then print out its quotient, with 2 decimal places.
Input
A line containing three decimal numbers with two decimal places separated by a space.
*Test Case 1
1.53·2.25·1.23
Output
A line containing the result with two decimal places.
2.80
*Test Case 2
Input
1.9 2.5 3.75
Expected Output
1.27
First, read in an input value for variable numInput. Then, read numInput integers from input and output each integer on a newline after the string "input = ".
Ex: If the input is 2 30 40, the output is:
input = 30
input = 401. A prime number is an integer greater than one and divisible only by itself and one.
The first seven prime numbers are 2, 3, 5, 7, 11, 13, and 17. Write a program that displays all the
prime numbers between 1 and 100
2. Write another program that accepts a number from the user and returns th Fibonacci value of that
number. You should use recursion in here.
3. Write a program that accepts a number and determine whether the number is prime or not.
4. Write a C++ code that computes the sum of the following series.
Sum = 1! + 2! + 3! + 4! + …n!
The program should accept the number from the user.
5. Write a C++ code to display only even numbers found between 222 and 180.
6. Write and run a program that reads a positive integer n and then prints a diamond of numbers Use for loop.
Given an array A (8,8). Find the sum and the number of positive elements, located below the main diagonal the smallest element of the array (minimum).
please help answer
Write a C program using the fork() system call that calculate the factorial in the child process. The number will be provided from the command line. For example, if 5 is passed as a parameter on the command line, the child process will output 120. Because the parent and child processes have their own copies of the data, it will be necessary for the child to output the result. Have the parent invoke the wait() call to wait for the child process to complete before exiting the program. Perform necessary error checking to ensure that a positive integer is passed on the command line.
OUTPUT
Enter the value of n: 5
The factorial of 5 is 120
Make a C++ program using do while loops that will print this output:
*
**
***
****
*****
Input
A line containing five integers separated by a space.
1·2·3·4·5Output
A line containing an integer.
4084101