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 of these statements regarding mobile games is true? A. They are typically played indoors. B. They have detailed environmen
Lyrx [107]

Answer:

c and d

Explanation:

6 0
3 years ago
The right of workers to seek safety and health on the job without fear of punishment is spelled out in:
mr Goodwill [35]
The answer to the question is C.
3 0
3 years ago
To change lowercase letters to uppercase letters in a smaller font size, which of the following should be done?
sergeinik [125]

Explanation:

Format the text in Small caps. Manually replace the lowercase letters with uppercase letters.

7 0
3 years ago
You want to securely erase data from your hard drive what can you use to do this and what is the process called
tankabanditka [31]
You could Factory Reset a computer or you could smash it with  a hammer
7 0
3 years ago
Read 2 more answers
Please describe how you can use the login page to get the server run two SQL statements. Try the attack to delete a record from
vekshin1
The only sure way to prevent SQL Injection attacks is input validation and parametrized queries including prepared statements. The application code should never use the input directly. ... Database errors can be used with SQL Injection to gain information about your database.
6 0
3 years ago
Other questions:
  • A programmer wrote the code segment below to display the average of all the elements in a list called numbers. There is always a
    8·1 answer
  • A computer that delivers requested webpages to your computer or mobile device is a(n) _________.
    9·1 answer
  • How is the JOptionPaneclass used to display a dialog box that performs a yes/noconfirmation?
    10·1 answer
  • A professional bureaucracy is a knowledge-based organization where goods and services depend on the expertise and knowledge of p
    7·1 answer
  • Which of the following should you do if your accelerator is stuck? A. Pump your brakes to build fluid pressure. B. Shift to Neut
    14·2 answers
  • Suppose a family has had a house fire in which
    7·2 answers
  • Can a idler gear increase or decrease torque?
    7·1 answer
  • I
    6·1 answer
  • Where is the element coded in a web page.
    13·1 answer
  • Which influence on spending deals with the motivation to<br> purchase a product?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!