Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assignment: In a mobile health app that tracks the daily water intake of its users, the users are encouraged to reach a daily goal of
Assignment: In a mobile health app that tracks the daily water intake of its users, the users are encouraged to reach a daily goal of water consumption for better hydration. The user's current water intake is stored in an integer variable currentIntake, measured in milliliters. If the user reaches the goal, the app awards points to their health score stored in the variable healthScore and displays a motivational message. In addition to this, the app also tracks how many days a user has hit their goal in the variable daysHitGoal.
Write the correct if statement that does the following if currentIntake exceeds milliliters the daily goal:
Adds points to healthScore.
Adds to daysHitGoal.
Prints a message to standard output congratulating the user for achieving their daily hydration goal.
The message should read "Congratulations! You reached your daily goal!"
Note: You must write the statement to check for the condition and the assignment of the correct value. Assume that you can use the std namespace objects freely.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started