Question: Goal: Write an if statement using conditions created with logical operators. Assignment: You are developing a software system for a community library. The system tracks

Goal: Write an if statement using conditions created with logical operators.
Assignment: You are developing a software system for a community library. The system tracks new book arrivals and categorizes them. Two
important pieces of information are the number of fiction and non-fiction books received.
Create a program with two integer variables: fictionBooks and nonFictionBooks. Without displaying any prompts, the program should
read a value of input into the fictionBooks variable, and then read a value of input into the nonFictionBooks variable. The program should
then print the total number of new books as "Total number of new books: x", where x is the total. However, if any input value is invalid,
the program should print "Your input is invalid!". Valid input criteria are as follows: both fictionBooks and nonFictionBooks must
be greater than or equal to 0.
Note: You must retrieve the correct data from standard input in the following order:
fictionBooks
nonFictionBooks
You must write a complete C++ program for this exercise.
Goal: Write an if statement using conditions

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!