Write a program that calculates how much a person would earn over a period of time if his or her salary is one ringgit the first day and two ringgit the second day, and continues to double each day. The program should ask the user for the number of days. Display how much the salary was for each day, and then show the total pay at the end of the period.
miazara
0
Newbie Poster
Recommended Answers
Jump to PostDo you have any code at all yet?
Jump to PostThis is a simple factoral problem. 1, 2, 4, 8, 16, 32, 64, 128...
As DaveAmour asks, do you have any code yet?
All 7 Replies
DaveAmour
160
Mmmmmm beer
Featured Poster
miazara
commented:
#include <iostream> #include <iomanip> using namespace std ; void main () { int total_month; float total_salary = 0, total_pay = 0; c
+0
rubberman
1,355
Nearly a Posting Virtuoso
Featured Poster
miazara
commented:
#include <iostream> #include <iomanip> using namespace std ; void main () { int total_month; float total_salary = 0, total_pay = 0; c
+0
AQ
0
Newbie Poster
Schol-R-LEA
1,446
Commie Mutant Traitor
Featured Poster
miazara
0
Newbie Poster
miazara
0
Newbie Poster
Schol-R-LEA
1,446
Commie Mutant Traitor
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.