Hi, I'm new to C++ programming and due to personal reason I missed class. I'm not sure how to approach this so I ask for help here. Don't get me wrong, I don't want someone to tell me the answer. I just want someone to help me get started. I have basic understanding of using functions and integers, this is just so confusing for me. Maybe I'm just thinking too hard. For this problem we have to use int and double
I had no issues writing the program below, the one that confused me was the one that im seeking help for now.
/*
This app computes the cost of transporting gallanide
to a colony in the current galactic sector.
*/
#include <iostream>
using namespace std;
int main() {
double DISTANCE_TO_PLANET = 500; // Light-Years
double pricePerKilogram = 25; // Credits per kilogram of gallanide
double kilogramPerLighyear = 12.5; // Kilograms per Light-Years
cout << "How many light-years to the colony's planet? ";
cin >> DISTANCE_TO_PLANET;
cout << "What is the price per kilogram of gallanide? ";
cin >> pricePerKilogram;
cout << "How many kilograms per light-year are used by the transport freighter? ";
cin >> kilogramPerLighyear;
There are a lot of ways of solving this problem but the simplest is to set up a number (approx 5 or 6) of arrays which store the various bits of information you are given in the question or the user inputs. Once the system has all the info then it can be processed using the formulas you're give and the results displayed.
The first step is to produce an array of lifeforms and continents. Think of int lifeFormNumber[x], char lifeFormContinent[x] ... x could be 20 or whatever.