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
EleoNora [17]
3 years ago
10

Assume that month is an int variable whose value is 1 or 2 or 3 or 5 ... or 11 or 12. Write an expression whose value is "jan" o

r "feb or "mar" or "apr" or "may" or "jun" or "jul" or "aug" or "sep" or "oct" or "nov" or "dec" based on the value of month. (So, if the value of month were 4 then the value of the expression would be "apr".).Again, conditional operator so I need to : and ? .(month==1)?"jan":(month==2)?"feb": (month==3)?"mar": (month==4)?"apr": (month==5)?"may":(month==6)?"jun": (month==7)?"jul":(month==8)?"aug":(month==9)?"sep": (month==10)?"oct": (month==11)?"nov": (month==12)?"dec": isn't quite right for the compiler I am currently using.
Computers and Technology
1 answer:
Tamiku [17]3 years ago
7 0

Answer:

The code is given below

Explanation:

The correct syntax would be to place appropriate parenthesis.

(month==1?"jan":(month==2?"feb":(month==3?"mar":(month==4?"apr":(month==5?"may":(month==6?"jun":(month==7?"jul":(month==8?"aug":(month==9?"sep":(month==10?"oct":(month==11?"nov":"dec")))))))))));

Similarly, you can also use the following code:

String[] months = { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" };

int month = 1;

String monthDescription = months[month - 1];

You might be interested in
In which area is composing for games similar to composing for
ankoles [38]

Answer:

The correct answer is C)

Explanation:

Movies and Video games make use of soundtracks.

To produce quality soundtracks, they must be created, mixed and edited using sound editing and mixing applications.

Examples of audio softwares are:

  1. Fruityloops
  2. Adobe Audition
  3. Audacity and
  4. TwistedWav

Cheers!

7 0
4 years ago
What is not true about contracts?
Brut [27]
If you sign a contract or official document with your non-dominant hand, you do not have to follow that agreement or set of rules
5 0
4 years ago
Read 2 more answers
What are the buisness debts called?
inessss [21]
Business debts are called:
B. Liabilities
4 0
4 years ago
What is a computer memory <br>​
Alex_Xolod [135]

Answer:

In computing, memory is a device or system that is used to store information for immediate use in a computer or related computer hardware and digital electronic devices. The term memory is often synonymous with the term primary storage or main memory. An archaic synonym for memory is store.

5 0
3 years ago
Read 2 more answers
How do you create a reference page in apa format with all websites?
Gre4nikov [31]
Use Cite This For Me's APA citation generator to create a reference page in APA format with all websites.
6 0
3 years ago
Other questions:
  • What does confidentiality of data refer to?
    6·2 answers
  • Which of the following represent features of
    6·1 answer
  • If the value of the expression,
    13·1 answer
  • If you need to provide a storage server with fault tolerance through the use of multiple paths between the server and the actual
    14·1 answer
  • Excel allows you to rotate text in a cell counterclockwise by entering a number between -1 degrees and -90 degrees. True or fals
    14·1 answer
  • How would you define media literacy?
    12·1 answer
  • Identify whether each of the following goals would be a short-term or long-term goal for a high school senior who will graduate
    12·2 answers
  • Write a method named countInRange that accepts three parameters: an ArrayList of integers, a minimum and maximum integer, and re
    6·1 answer
  • Setting up a desktop computer for anAutoCADspecialist who needs a minimum of 125 GBram which operating system would be the best
    5·1 answer
  • Complete each sentence. To add a graphic to a Word document, start by clicking the tab. Next, click . Then, navigate to the grap
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!