Homework feedback

Alright, so these were the apparent mistakes I made in my assignment.
// -1 correctly formed conditional(s) - MISSING
-1 WRONG ANSWER – LOOK AT THE EXAMPLE OUTPUT IN THE HOMEWORK INSTRUCTIONS

Can someone explain what a correctly formed conditional is and why I didn't correctly form it?

Also, this is the example output in the homework instructions.

11 Time Calculator
example output:

Time Calculator
When asked,
enter a number of seconds to determine the:
number of days (86400 seconds in a day)
number of hours (3600 seconds in a hour)
number of minutes (60 seconds in a minute)
remaining secondsÏ

Enter a number of seconds:
90061
1 day(s)
1 hour(s)
1 minute(s)
1 second(s)

But I'm still a bit confused how this helped me. Can someone explain? Thanks!




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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//Ashton Dreiling
//Seconds exercise
#include <iostream>
#include <stdlib.h>

using namespace std;

//module prototypes
void calculateDaysHoursMinsAndRemainSecs (double &Days, double &Hours, double &Minutes, double &remainingSeconds,
                                          int seconds);

//global constants
const int VALUETOCALCULATEDAYS = 86400;
const int VALUETOCALCULATEHOURS = 3600;
const int VALUETOCALCULATEMINS = 60;
const int VALUETOCALCULATEREMAINMINS = 60;

int main()
{   //some variables
    double Days;
    double Hours;
    double Minutes;
    double remainingSeconds;
    int seconds;

    cout << "We are going to have you input an amount of seconds to determine the days, hours, minutes, and remaining seconds." << endl;
    cout << "Please enter the amount of seconds of your choice." << endl;
    cin >> seconds;
    cout << "You typed in " << seconds << " seconds." << endl;
    cout << "We will now determine the days, hours, minutes, and remaining seconds based off of your input." << endl;

    //pass variables to calculate days, hours, minutes, and remaining seconds
    calculateDaysHoursMinsAndRemainSecs(Days, Hours, Minutes, remainingSeconds, seconds);
    cout << "There are " << Days << " Days." << endl;
    cout << "There are " << Hours << " Hours." << endl;
    cout << "There are " << Minutes << " Minutes." << endl;
    cout << "There are " << remainingSeconds << " remaining seconds." << endl;



    system("Pause");

    return 0;
}//end main

void calculateDaysHoursMinsAndRemainSecs(double &Days, double &Hours, double &Minutes, double &remainingSeconds, int seconds)
{   //Calculating values
    Days=(seconds/VALUETOCALCULATEDAYS);
    Hours=(seconds/VALUETOCALCULATEHOURS);
    Minutes=(seconds/VALUETOCALCULATEMINS);
    remainingSeconds=(seconds % VALUETOCALCULATEREMAINMINS);


}//end calculateDaysHoursMinsAndRemainSecs
I don't see any conditionals, well-formed or otherwise.

If the user enters 86400, your program will output that there are "1 day, 24 hours, 1440 minutes, and 0 seconds", when it should output "1 day, 0 hours, 0 minutes, 0 seconds". Can you figure out what the problem is?
closed account (48T7M4Gy)
It depends on the original question whether conditionals are required.
Hold on, let me get the original question. Clearly, it must've been, since I missed points for not including them.
http://prntscr.com/bl2s1y

I'm not sure what exactly I missed or why I got the wrong answer.
Topic archived. No new replies allowed.