Examlex

Solved

Public Class EnumExample

question 54

Essay

public class EnumExample
{
    enum Day {SUNDAY, MONDAY, TUESDAY, WEDNESDAY,
              THURSDAY, FRIDAY, SATURDAY };

    Day day;

    public EnumExample(Day day)
    {
        this.day = day;
    }

    public void giveFeedback()
    {
        switch (day)
        {
            case MONDAY:
                System.out.println("Mondays are bad.");
                break;

            case FRIDAY:
                System.out.println("Fridays are better.");
                break;

            case SATURDAY: case SUNDAY:
                System.out.println("Weekends are best.");
                break;

            default:
                System.out.println("Midweek days are so-so.");
                break;
        }
     }

    public static void main(String[] args)
    {
        EnumExample firstDay = new EnumExample(Day.MONDAY);
        firstDay.giveFeedback();
        EnumExample thirdDay = new EnumExample(Day.WEDNESDAY);
        thirdDay.giveFeedback();
        EnumExample fifthDay = new EnumExample(Day.FRIDAY);
        fifthDay.giveFeedback();
        EnumExample sixthDay = new EnumExample(Day.SATURDAY);
        sixthDay.giveFeedback();
        EnumExample seventhDay = new EnumExample(Day.SUNDAY);
        seventhDay.giveFeedback();
    }
}
Using the above enumeration and code, what will be the output when the program is executed?

Learn the necessary steps for closing a sale.
Understand the role of trust and relationships in sales.
Realize the importance of problem-solving and creativity in sales strategy.
Recognize the varied needs of business-to-business buyers.

Definitions:

Freud-Gestalt Psychology

An approach that incorporates elements of Freud's psychoanalytic theory and Gestalt psychology, focusing on unconscious processes and perceptions in understanding behavior.

Classical Conditioning

A learning approach whereby two stimuli are consistently associated together; the second stimulus initially generates a response which ultimately is generated by the first stimulus alone.

Cognitive Development

The process through which individuals acquire and evolve in their problem-solving abilities, memory, language, and understanding of the world.

Intelligence Testing

The assessment and measurement of an individual's intellectual capabilities and potential.

Related Questions