[ Foro de C ]

ejercicio en c

04-Dec-2022 19:04
Invitado (el polo)
0 Respuestas

A textile multinational needs a program that tells them how many young people (people between 15 and 35, including both values) buy from that company. In addition, it will be necessary to indicate for each customer the size of clothes they use. Equivalences are XS for sizes 34 and 36, S for sizes 38 and 40, M for sizes 42 and 44 and L for sizes 46, 48, 50 and 52.

The program asks for a string (maximum 500 characters) that includes the following information for each client (note the format):

<name>.<surname>:<age>#<size>
And if there is more than one client in the list, the full format is:

<client1>||<client2> and so on.

So write a program that asks the user for the string with the information about the customers and displays the following information on the screen:

• List of clients with the corresponding font size. Keep in mind that some sizes may not exist and in these cases the message "Warning! One of the sizes listed does not exist."


• Total of young people.

Here are some running examples:







Example 1:

Full information: Sean.Brown:33#54
Warning! One of the sizes listed does not exist.
Total of young people: 1
Example 2:

Complete information: Felicity.Wright:45#36
The customer Felicity Wright has XS size.
Total of young people: 0
Example 3:

Enter information: Emily.Smith:28#34||Harry.Jones:40#52||Jacob.Taylor:18#44||Emma.Williams:39#38
The customer Emily Smith has XS size.
The customer Harry Jones has L size.
The customer Jacob Taylor has M size.
The customer Emma Williams has S size.
Total of young people: 2




Si ya eres usuario del sistema, puedes contestar desde tu cuenta y así ganar prestigio.

Si sólo eres un visitante, puedes optar por...