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 nonfiction 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: where 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
Note: You must retrieve the correct data from standard input in the following order:
fictionBooks
nonFictionBooks
You must write a complete program for this exercise.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
