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
Which is a requirement for searching for a template
Lina20 [59]

Answer:

umm... you did not discribe the anwsers, i cannot help you

8 0
3 years ago
Write a function using statements called Print Reportl) which will take no float
Sedbober [7]

Answer:

the answer is going to be district b

5 0
3 years ago
MATH PLZ HELP ITS DUE IN 4 MINUTES​
zheka24 [161]

Answer:

2

Explanation:

8 0
3 years ago
Read 2 more answers
(word excel)
Aloiza [94]
D is the answer to that problem
7 0
3 years ago
Lines, block arrows, stars, and banners are examples of which of the following
bija089 [108]

Answer:

Lines, block arrows, stars and banners are examples of which of the following is smart art graphic

7 0
3 years ago
Other questions:
  • How should you decide what to wear to an interview? What kind of things should be considered?
    5·1 answer
  • Kendall receives an email stating that a leading computer company is giving away free computers, asking her to forward the email
    15·1 answer
  • I want to be a teacher some day and i know this question------------- Humans have a nose to breath , but what do fishes use to h
    6·2 answers
  • He primary purpose for attackers to send port scanning probes to hosts is to identify which ports are open. true false
    5·1 answer
  • Can someone help me out with this question?​
    9·1 answer
  • Which principle suggests that specific single responsibility interfaces are better than one general purpose interface?
    13·1 answer
  • I NEED answers for these qu plz
    5·1 answer
  • Pls help I will give points
    11·1 answer
  • _______ is the use of software to assist in the creation, analysis, and modification of the design of a component or product.
    9·1 answer
  • Why big data influnce the rise of AI<br><br>​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!