.c program The Problem Statement You and your roommates go through a lot of orange juice.  Since you're living on a college budget, you've decided that it's critical for you to take advantage of the "Buy One Get One" (BOGO) free offers at the nearby grocery store. Program Setup Your C program should ask the user to enter the price of one carton of juice as well as the number of cartons being purchased. Note that since juice is an ordinary grocery item, no sales tax is charged on it. Then, determine the final cost of buying orange juice under the BOGO offer.  While it is possible to make a solution that does not use If Statements, the purpose of the assignment is to practice with conditions.  Make sure you take this opportunity to get the practice you need to master the programming concepts. You'll need to account for two different cases: buying an even number of OJ cartons and buying an odd number of OJ cartons.  How can you determine if a number is even or odd?  A number that is evenly divisible by 2 is even.  An odd number has a remainder of 1 when divided by 2.  Which arithmetic operator gives you the remainder?

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 28PE
icon
Related questions
Question

.c program

The Problem Statement

You and your roommates go through a lot of orange juice.  Since you're living on a college budget, you've decided that it's critical for you to take advantage of the "Buy One Get One" (BOGO) free offers at the nearby grocery store.

Program Setup

Your C program should ask the user to enter the price of one carton of juice as well as the number of cartons being purchased. Note that since juice is an ordinary grocery item, no sales tax is charged on it.

Then, determine the final cost of buying orange juice under the BOGO offer.  While it is possible to make a solution that does not use If Statements, the purpose of the assignment is to practice with conditions.  Make sure you take this opportunity to get the practice you need to master the programming concepts.

You'll need to account for two different cases: buying an even number of OJ cartons and buying an odd number of OJ cartons.  How can you determine if a number is even or odd?  A number that is evenly divisible by 2 is even.  An odd number has a remainder of 1 when divided by 2.  Which arithmetic operator gives you the remainder?

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr