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
Ne4ueva [31]
3 years ago
8

Assume the variable date has been set to a string value of the form mm/dd/yyyy, for example 09/08/2010. (Actual numbers would ap

pear in the string.) Write a statement to assign to a variable named dayStr the characters in date that contain the day. Then set a variable day to the integer value corresponding to the two digits in dayStr.
Computers and Technology
1 answer:
bonufazy [111]3 years ago
6 0

Answer:

String date = "21/05/2020";

String dayStr = date.substring(0,2);

int day = Integer.parseInt(dayStr);

System.out.println(day);

Explanation:

Create a variable called <em>date</em> which holds the current date

Create a variable called <em>dayStr</em>. Initialize it to the day part of the <em>date</em> using the substring method

Create a variable called <em>day</em>. Parse the <em>dayStr</em> and assign it to the <em>day</em>

Print the <em>day</em>

You might be interested in
Shortcuts will help you complete spreadsheet tasks more efficiently.
max2010maxim [7]
Ctrl(control) + s = save
Tab = auto complete formula
ctrl +c =copy'
ctrl+v = paste
ctrl +z = undo

you can also drag your formula down different cells

3 0
3 years ago
Ron is creating building blocks in Word. How can he make the building blocks that he created available?
daser333 [38]

A) Store those building in Normal template

7 0
3 years ago
Read 2 more answers
I NEED HELP WITH SOME PROBLEM ON BRAINLY PLEASE HELP
docker41 [41]
What is the issue,please tell me so i can know ur question
6 0
3 years ago
write a c++ program that takes a string input from the user and removes all characters except numerals also display the number o
Xelga [282]

Answer:

hi

Explanation:

5 0
3 years ago
It is important to use as much text as possible in a presentation. <br> a. True<br> b. False
Kryger [21]
False. You should have little text and lots of pictures, because you are the one who should be doing the explaining, not the presentation.
4 0
3 years ago
Other questions:
  • After a robbery, what is the purpose of conducting a neighborhood canvass?
    9·1 answer
  • Create a program that reads words.txt (link near top of our home page) in order to: determine the length of the longest word(s)
    14·1 answer
  • You are an administrator for contoso.com. you have two servers called server1 and server2 that run windows server 2012 and have
    9·1 answer
  • Question 14. (3.04 MC) how does the project manager evaluate the scope of a project
    14·1 answer
  • Test if a number grade is an A (greater than or equal to 90). If so, print "Great!". Sample Run Enter a Number: 98 Sample Output
    7·1 answer
  • What helped Taylor through her tough time with being bullied
    7·1 answer
  • What is the use of a piano​
    10·2 answers
  • If you were practicing keyboarding and the exercise contained the letters j, k, l, m, n, and b, what section of the
    14·1 answer
  • If your cell phone rings while you are driving and you do not have a hands-free device you should
    9·1 answer
  • Can someone help me debug this please
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!