1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
slamgirl [31]
3 years ago
7

Write a menu-driven program for a user to store information about the media collection they own. This requires using an array of

struct type called Media. Every element in the array represents one media item in a person's collection. Represent the information as an array of structs that needs to able to hold up to 100 media entries. However, the actual number of entries is probably much smaller so the program needs to keep track of how many actual entries are in the collection.

Computers and Technology
1 answer:
Phoenix [80]3 years ago
7 0

Answer:

Check Explanation and attachment.

Explanation:

Since the site does not allow me to submit my work(for you to easily copy and paste it), I will post some additional attachments.  

Please, note that there is category, unique ID, description for each media item.

#include <stdio.h>

#include <string.h>

struct Media {

int id;

int year;

char title[250];

char description[250];

char category[50];

};

void show_menu();

void add_item(struct Media arr[], int *c);

void print_all(struct Media arr[], int c);

void print_category(struct Media arr[], int c);

void delete_entry(struct Media arr[], int *c);

int main() {

struct Media collection[100];

int ch, count = 0;

// loop until user wants to quit

while (1) {

show_menu(); // display the menu

printf("Enter your choice: ");

scanf("%d", &ch);

if (ch == 1)

add_item(collection, &count);

else if (ch == 2)

print_all(collection, count);

else if (ch == 3)

print_category(collection, count);

else if (ch == 4)

delete_entry(collection, &count);

else if (ch == 0)

break;

else

printf("Invalid choice. Try again!\n");

}

return 0;

}

void show_menu() {

printf("1. Add a media item to the collection\n");

printf("2. Print all media in the collection\n");

printf("3. Print all media in a given category\n");

printf("4. Delete an entry\n");

printf("0. Quit\n");

}

void add_item(struct Media arr[], int *cnt) {

You might be interested in
What is a cell address in xsl sheet
fgiga [73]

Answer:

cell address is the exact location of a particular cell of ms-excle

Explanation:

A1 refers to first row and first column.

A2 refers to second row first column.

i.e.

in 'A1' : 'A' indicate column { A= first column, B= second

column, C= third column. and soon.....}

'1' indicate row { 1 = first row, 2 = second row, 3= third row..... soon .......}

5 0
3 years ago
Fiona is creating a presentation with PowerPoint Online about how pencils are made. She would like to type an explanation about
777dan777 [17]

Answer:THE ANSWER IS A.

Explanation:I DID IT AND I GOT 100

6 0
3 years ago
. Explain how semaphores are handled in embedded systems design
Readme [11.4K]

Answer:

 Semaphores carries the signal between the task and interrupts that does not carry any type of additional data in the embedded system. A semaphore is used as synchronization object and helps in maintain the value between zero and the specific higher value.  

It basically reduced the value each time and complete the semaphore object in the embedded system. Binary semaphores is the main type of semaphore that invoke activation of the task.

 

5 0
3 years ago
In which stage of the design process does the designer ask him or herself what the audience already knows about thes problem
motikmotik
<span>The designer will ask him or herself during the problem statement stage what the audience or user already knows about the problem. A. Identify the need or problem.</span>
7 0
3 years ago
A business that subscribes to a specific computing model has its entire system fully functional within a short time. What benefi
ASHA 777 [7]

Answer

economies of scale

Explanation

Cloud computing  is the practice of using a network of remote servers hosted on the Internet to store, manage, and process data, rather than a local server or a personal computer.  Benefits of moving everyday business to the cloud is that it can provide small businesses with significant savings. In cloud computing Virtualization increases the value of physical server hardware, meaning businesses can do more with less.Business that subscribes to a specific computing model has its entire system fully functional within a short time  will have economies of scale benefit. This is because this will be consuming information technology that can lead to significant cost saving.


6 0
3 years ago
Read 2 more answers
Other questions:
  • 1. of the following individuals, who was the most recent to develop information searching tools online? (points : 1) otlet wells
    5·1 answer
  • Which social network site has 1.5 billion actives users per month?
    15·1 answer
  • I need an answer and fast What happens if a sequence is out of order?
    5·2 answers
  • Where (what memory location) is the data read from for the following code:
    12·1 answer
  • Which is true about POP3 and IMAP for incoming email?
    13·1 answer
  • 60 POINTS!! WILL MARK BRAINLEST!!
    11·1 answer
  • How I to turn this ''loop while'' in ''loop for''? var i = 0; while (i &lt; 20) { var lineY = 20 + (i * 20); line(0, lineY, 400,
    11·1 answer
  • use the internet to research the SYSTEM account. Why is it nessesary to include this account with full control on a directory
    13·1 answer
  • You have been given a laptop to use for work. You connect the laptop to your company network, use it from home, and use it while
    14·1 answer
  • g You and your friend both send documents to the printer, but the printer can only print one document at a time. What does it do
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!