Day of the week

  • 4
  • unavailable
Planet Terra still has "offices"—an outdated type of workspace. With current technology, there is no need for them, but earthlings tend to be nostalgic and haven't been in a hurry to eradicate them. Terrestrial office workers develop "TGIF syndrome": they constantly want to know what day of the week it is. Let's write a program for them!
You can't complete this task, because you're not signed in.
Comments(12)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
SkynetLevel 11
31 October, 15:29
Used a more advanced code, which we have not covered so far. Created a String array, to which I added "No such day of the week" and all of the days of the week in the correct order (i.e. 8 entries in total). Then used an if statement with a condition: if the entered day of the week is higher than 0 AND less than 8, then output the entry of the array which corresponds to the entered number by index (i.e. if you entered 2, then you will get "Tuesday"). Did not need any conditions in the else statement, just the output of the first index of the array (e.g. yourArray[0]), which means that the true output will be the "No such day of the week" text, which is assigned to the first index of the array.
SteveLevel 9 , Denver
23 June, 12:50
I used switch,, it works fine
shabarish kumarLevel 16 , Hyderabad
19 May, 05:28
Are we not supposed to use Switch here!
akshaLevel 6 , pune
18 May, 07:10
Error converting a string to a number (invalid format). everytime this error is there.What should I do?
DmanLevel 5 , Working from G1 1EJ, Glasgow UK.
6 May, 12:03
I am running this exercises in the webpage, should I be doing each and everyone in the IDE by now?
AlexLevel 41
6 May, 12:56
It's up to you really. However, you will find that the further you go in the course the more helpful IntellijIDEA will become. Plus, you will have to familiarize yourself with it at some point anyway. The big tasks available in the Collections/Multithreading quests will need to be completed in IntellijIDEA, for example.
Oleksii LeshchenkoLevel 14 , Kiev
19 February, 11:32
Used HashMap<Integer, String>
code seema palLevel 4 , Noida
25 October 2018, 05:55
below is the verification result , please help problem is at number 4 if u enter a number outside the range of 1 to 7 then display a notification that there is no such day of the week 1 The program should read a number from the keyboard. 2 The program should display text on the screen. 3 If you enter a number from 1 to 7, you need to display the name of the day of the week. 4 If you enter a number outside the range of 1 to 7, then display a notification that there is no such day of the week.
RomanLevel 41
25 October 2018, 06:16
If you need help, something isn't right in your code, the server won't accept your solution (even if you are 100% sure that it is correct). Describe your question/issue in the HELP section at codegym.cc/help.
18 March, 16:02
else if(n>7 && n<1)
         System.out.println("No such day of the week");
It is wrong. Replace by
else if(n>7)
         System.out.println("No such day of the week");
Vishwambhar AwaganLevel 8 , Pune
1 October 2018, 16:07
I am getting whats wrong in it..
RomanLevel 41
2 October 2018, 06:14
If you need help, something isn't right in your code, the server won't accept your solution (even if you are 100% sure that it is correct). Describe your question/issue in the HELP section at codegym.cc/help. ps Look carefully at the recommendation from your mentor