Need a program created

The program that needs to be created is:

Out in space,there are these species which are called Billies. A billy multiplies twice, on average, every week to keep their species alive due to the fact that they live in harsh environments. Every month, 3/4th of the Billies will die. Make a program to calculate and show how many Billies will survive in 1 year. (There are 4 weeks in a month, and 12 months in a year)

Example:(What User Sees)
Enter number of Billies to start: x
Number of Billies on the first month = x
Number of Billies on the second month = x
And so on... (Until you reach 1 year)
About x Billies will survive per year.

The sooner the better for getting this program created. Thank you very much!
Last edited on
If you're trying to recruit a programmer to write a program for you, you should post to the Jobs forum. Please remember to include your payment rates.
Someone should help him out it will take like 5 minutes. I would if I could
He/she will learn better by doing, than by simply being given a piece of code written by someone else.
I would learn better but a working version of this would be nice for reference on when working on my own version.
@cjhaen do you have a start at least?
Not currently would like a working version of it to reference on when working on this project.
> a working version of this would be nice for reference on Ywhen working on my own version.

Yes.

Here's my version; now try to make one of your own.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>

int main()
{
    // we will make the following assumptions (the question leaves it unstated)
    //     'multiplies twice every week' means the number will increase by a factor of two every week
    //     at the end of every months, the deaths take place
    //     after the billies have multiplied for the last week of the month.

    // with these assumption, if the number of billies was 'n' at the start of the month
    // at the end of the month, before the billies die, the number of billies is
    //    n*2*2*2*2 (four weeks) == n * 16
    // at the very end of the month, 3/4th die, 1/4th survive,
    // the number of billies left is a fourth of n*16  == n*4 ;

    const int multiplier_per_week = 2 ;
    const int multiplier_per_month = multiplier_per_week * multiplier_per_week *
                                     multiplier_per_week * multiplier_per_week / 4 ;


    // accept number of initial billies from user
    unsigned long long num_billies ;
    std::cout << "number of billies? " ;
    std::cin >> num_billies ;
    // we will assume that the initial number of billies is small enough
    // to make our computations remain within the largest value that unsigned long long can hold

    const int num_months_per_year = 12 ;

    for( int month = 0 ; month < num_months_per_year ; ++month ) // for each month in the year
    {
        num_billies *= multiplier_per_month ;
        // print out the number of billies at the end of the month
        std::cout << "at the end of month " << month+1 << ", number of billies == " << num_billies << '\n' ;
    }
}
I've always been a supporter of directing requests like these to the Jobs section and there are several reasons for it. The largest one, is ownership. If you ask someone to do an assignment for you, then claiming that work as your own is plagiarism. But if you pay someone for the service then you as the employer retain the IP to the code that is produced. This idea is pretty much universal and it's the only way that software companies survive when their employees leave.

Another concern is quality\trust. Helping someone out with tweaking their code is far different from producing the end product in it's entirety. When you are helping someone, the quality of the end product is ultimately up to their skill level and they can't blame anyone else but themselves for a crappy end result. But if someone else is doing the work for them then there should be something in place to ensure the end product is up to par. Both parties should have a vested interest in the outcome of the project. Think about this another way, if someone has agreed to do this work for you then what's to stop them from wasting your time with "I'll have it done for you in a few hours..." until you miss your deadline? Or are you the kind of person to ask ten people to do the same favor for you so that no matter what you end up wasting someones time?

I'm all for volunteerism, but if you sit down and think about it, it doesn't fit this scenario very well.
Not currently

So you've made no effort whatsoever to do the work you've been set to do? Is that right?
cjhaen,

Reading C++ code is an essential ingredient to learning the language, when you try to understand the code, work with it, play around with it, modify it, try to improve it, rewrite it in your own way.

For instance, if you want to learn more about the classical for loop, read the text, but also look at the examples code (a complete, runnable program) at the bottom of the page.
http://en.cppreference.com/w/cpp/language/for
Study it, compile and run it, modify it, write some loops on your own ... That is what cements learning.

The ownership of anything that I post in these forums is community ownership. Feel completely free to use it in any way that you deem appropriate; you own it, just as much as anyone else does.
Topic archived. No new replies allowed.