Explore BrainMass
Share

A C program that uses enumerated types

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

Create a set/list of enumerated constants called week that contains the days of the week. Have a variable called today that is of type week. Assign a value to today. If the day is Monday through Friday, print "Go to work!" If the day is Saturday or Sunday, print "You can rest today!"

© BrainMass Inc. brainmass.com October 24, 2018, 10:39 pm ad1c9bdddf
https://brainmass.com/physics/ac/a-c-program-that-uses-enumerated-types-166088

Solution Preview

The point of using an enumeration type is that you can provide symbolic names for values that are related. The example of days of the week is a good one. We define an enum using the following statement:

enum week {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday};

This provides us with an enum that is available for us to use for other variable declarations. So we can create a variable "today" like this:

enum week today;

Now it is possible to assign the value "Monday" to this variable:

today = Monday;

Notice that we're not using " around the name Monday. That's ...

Solution Summary

In this solution I provide a simple and easy to understand C program that uses an enumerated type to represent the days of the week. The program reads input from the user and prints a different message depending on which day of the week was entered.

$2.19
See Also This Related BrainMass Solution

Case Study Analysis - FOR BUSINESS ANALYSIS EXPERTS ONLY PLEASE!

If you can present this in a PPT format this will be most helpful! Use attached PPT as your guide. Thank you very much.

Please read the case study and provide input that will help me with a presentation and grasp understanding of the material and layout in a Story Board format (attached). This is to be an objective analysis. Key issues I'm interested in include:

a. What are the critical factors? How did the project(s) in the case study align, or not align with the organization's goals, and how did that alignment or lack thereof, contribute to the results. A full but concise analysis of the situation the business is in and how the actions taken were or were not in alignment with the organization's goals and how that contributed to business results. Include additional support and clarification around one or more of the situational findings in the case.

b. What are alternative solutions? How did the organization come to choose its project(s) and solution(s) and what were the advantages and disadvantages of those choices? Weigh alternative solutions and include a discussion of advantages and disadvantages of the choices. Challenge the results of the case study by describing other factors that might have impacted the results.

c. What is the recommended solution? What adjustments to the project selection process would you have made? Include support for the case or offer alternative project selection processes and criteria and defend how they would better apply in the case study. Include a number of other project selection processes and criteria and successfully defend elimination of those that weren't chosen.

d. What is the action plan? What recommendation do you have for this company to implement a better project selection prioritization process? Include clear analysis with more than one option or course of action that might be used to prioritize projects in the organization, recommend a methodology, and provide logical support for the recommendation. Assess the value of the options not chosen as well as supporting the recommended option.

Please do not copy, cut & paste text, copy from previous postings, or provide instructions on "how-to" from various internet sites as a response. I am also looking for perspective from an expert in this area or industry!

Thank you kindly for your assistance.

View Full Posting Details