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
Given 4 floating-point numbers. Use a string formatting expression with conversion specifiers to output their product and their
Snowcat [4.5K]

Answer:

search it on

Explanation:

<h2>GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE</h2>
5 0
3 years ago
Windows uses a memory-management technique known as ________ to monitor which applications you frequently use and preloads them
ad-work [718]
Windows uses a memory-management technique known as SuperFetch to monitor which applications you frequently use and preloads them into your system memory.
This technique is designed to speed up app launching by preloading certain apps based on the usage patterns of the user.

4 0
3 years ago
I really want to know the best way to deal as much heart as possible plz tell me
Natasha2012 [34]

Answer:

Set aside time every day for doing something that feels positive, whether that’s journaling, meeting up with a close friend, or watching a show that makes you laugh. Scheduling in moments that bring you joy is vital for healing a broken heart. It’s important to talk about your feelings with others and not numb yourself out.

Explanation:

7 0
3 years ago
Read 2 more answers
The ability to learn a new computer software program is to ____________ as knowledge of state capitals is to _____________.
Montano1993 [528]
<span>The ability to learn a new computer software program is to ADAPT as knowledge of state capitals is to COMMIT. Learning something new is to adapt and take time to study and learn what needs to be done in order for the task you wish to happen. To have knowledge of a specific thing, is to committing that face to your memory.</span>
8 0
3 years ago
. SQL is a(n) _____ language.
Blababa [14]

Answer: Fourth- generation language

Explanation:Structured Query Language (SQL) is the language that is in the form of database structure which helps in the manipulation of the data and management as well.

SQL is considered as the fourth generation language because it is used for the accessing of the data from the database.It is also known for the advancement in the third generation language and thus also improving the language interface with users.

7 0
4 years ago
Other questions:
  • Angela wrote some lines of code that she wants to test. She will need to use __________. IDLE open source a prompt a file path
    15·2 answers
  • Read the description of Mike’s work, and identify his profession. Mike’s job is to record sounds in a studio. He studies a video
    14·2 answers
  • One metric ton is approximately 2,205 pounds.
    6·1 answer
  • You are working on a router that has established privilege levels that restrict access to certain functions. you discover that y
    5·1 answer
  • Mark for review (Will be highlighted on the review page) 11. A feature in Excel that allows you to graphically display in a sing
    10·1 answer
  • The section of the browser window highlighted in yellow is the _____.
    11·1 answer
  • In 4-bit two's complement representation, what is the binary encoding of the number -5?
    8·1 answer
  • How do i beat the final battle in lara croft: temple of osiris?
    9·1 answer
  • Please help ASAP!!! :))
    9·1 answer
  • Explain what this program is doing ​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!