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 the current situation, how do you access information as a student? How will you integrate the use of ICT in your daily life a
3241004551 [841]

Answer:

Explanation:

As a computer science student information is accessed in every possible way. This can be through a local school lan network, mobile devices, e-mail, etc. All of these help information flow to and from various people and makes obtaining this information incredibly simple as a student. Especially in the field of computer science, I need to integrate as many ICT devices with me in my everyday life, to send emails, check calendar updates, research information on the web, check school reports, and even speak with clients.

3 0
3 years ago
Which factors effect a population growth regardless of population size?
pshichka [43]

Disease, disease will dwindle a population.

Government, depending how the government operates, it could easily drive people out of it.

-TheOneandOnly003

4 0
4 years ago
The main reason for using a comment in your HTML code is to
zvonat [6]

Answer:

D, document and explain parts of code

Explanation:

Mark me brainliest :)

8 0
2 years ago
The accounting department moved its network-attached printer from one side of the office to a more centralized location, making
IrinaK [193]

Answer:

The cable run connecting the new keystone jack to the patch panel is bad.

The patch panel connector for the new location's cable run is not connected to a switch.

Explanation:

7 0
3 years ago
Describe how you would make the remote-controlled car on the right drive forward.
Ludmilka [50]

You will need to read the insturctions.

4 0
3 years ago
Read 2 more answers
Other questions:
  • In a spreadsheet, cells B2 through B10 store the cost price of items and cells C2 through C10 store the selling price. If the se
    12·2 answers
  • To copy and paste from an excel workbook to a word document, you must first
    6·1 answer
  • Select the correct answer.
    6·1 answer
  • In python please.
    6·1 answer
  • Amanda needs to create an informative print brochure for her local library’s fundraiser dinner. What critical detail must she ha
    9·1 answer
  • Network in which every computer is capable of playing the role of the client, server or both at the same time is called *
    6·1 answer
  • If the floating-point number representation on a certain system has a sign bit, a 3-bit exponent, and a 4-bit significand. What
    8·1 answer
  • If you get a flat tire on the side of the road, what do you do.
    6·1 answer
  • Hi I'm new here can everyone add me as frein ​
    8·1 answer
  • Anil needs to show the overlap of people who live in a certain neighborhood in his city and who support a specific political can
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!