Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please Help me to write this program in language C. I put the whole problem beca

ID: 3848797 • Letter: P

Question

Please Help me to write this program in language C. I put the whole problem because I think it will be too difficult to understand if the problem is broken up into pieces.

If someone can add notes of //"comments" in the program to give help I would greatly appreciate that also. Thanks in advance! :)

Important Notes i. Formatting: Make sure that you follow the precise recommendationsfor the output content and formatting: for example, do not change the text of the problem from "Enter volumes and price per volume for collection l to Enter volume, price Your assignment will be auto-graded and any change in formatting will result in a loss in the grade. 2. Comments: Header comments are required on all files and for the rest of the recommended program. Points will be deducted if no header comments are included. Problem 1. Write a program that asks the user to enter information about three book collections. Each collection has a number of volumes and a price per volume (same for each volume in the collection). The program should ask how many volumes and what is the price per volume for each collection, as well as a budget available for abuyer named Bob. All values entered should be integers. The program should evaluate a set of logical expressions and print out specific messages based on the truth value of those expressions The expressions are as follows: (l) Bob has some money to buy collections. If the condition is false, the program should print: (l) Bob does not have money to buy anything

Explanation / Answer

#include<stdio.h>

#include<conio.h>

void main(){

int i,col_pr[3],vol,vol_pr,budget;

for(i=1;i<=3;i++){

printf(" Enter volumes and price per volume for collection %d : ",i);

scanf("%d%d",&vol,&vol_pr);

col_pr[i-1]=vol*vol_pr;

}

printf(" Enter Bob's budget : ");

scanf("%d",&budget);

if(buget>=col_pr[0] || budget>=col_pr[1] || budget>= col_pr[2]){

printf("Bob has some money to buy collections ");

]

else{

printf("Bob does not have money to buy anything ");

}

if((budget<=col_pr[0]&&budget<=col_pr[1]) || (budget<=col_pr[1]&&budget<=col_pr[2]) || (budget<=col_pr[0]&&budget<=col_pr[2]))

printf("Atleast two collections are cheaper than or equal to Bob's budget ");

else

print("Atleast two collections are expensive than Bob's budget ");

if((col_pr[0]==col_pr[1])||(col_pr[1]==col_pr[2])||(col_pr[0]==col_pr[2]))

printf("Atleast two collections cost the same amount of money ");

else

printf("No two collections have the same price ");

if((budget>col_pr[0]&&budget>col_pr[1]&&budget<=col_pr[2])||(budget>col_pr[1]&&budget>col_pr[2]&&budget<=col_pr[0])||(budget>col_pr[0]&&budget>col_pr[2]&&budget<=col_pr[1]))

printf("only one collection is cheaper than Bob's budget ");

else

printf("More than one collection are cheaper or they are more expensive than Bob's budget ");

getch();

}