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
How can you ensure that your web pages are compliant with a w3c standard?
miss Akunina [59]
Use a code validation tool.
6 0
3 years ago
The following outline is used to plan a program. What is the name for this type of plan?
vladimir1956 [14]
Pseudocode is the answer
7 0
3 years ago
Read 2 more answers
Camera lenses typically have very long focal points. true or false.
Alisiya [41]
No, it is false. This is mainly because there would be no need.
8 0
3 years ago
Read 2 more answers
Write a function named “createPurchaseOrder” that accepts the quantity (integer), the cost per item(double), and the description
Leona [35]
#include
Program: using namespace std;
string createPurchaseOrder0;
int main(
{
cout<return 0;
}
string createPurchaseOrder(
{
int qty;
double costPerltem;
string description,info="":
cout<<"Enter Quantity:
cin>>qty;
cout<<"Enter cost per item: "
cin>>costPerltem;
cout<<"Enter Description: "
cin>>description;
if(qty<0 I| costPerltem<0
Idescription.compare(''"')==0)
cout<<'InThe entered data is invalid!":
info="":
else
"
cout<<"'InThe entered data is valid!":
info=info+"'(nQuantity: "+to_string (qty) +" In";
info=info+"Cost per item:
"†to_string (costPerltem)+"In";
info=info+"Description: "description+" In";
return info;

Output:
4 0
2 years ago
Common input devices include the keyboard, ____, and integrated video cameras.
Yuliya22 [10]
Common input devices include the keyboard, image scanner, and integrated video cameras. These also include the microphone, mouse, joystick controller, gamepad or joypad, webcam, digital pen, and others. Input devices are computer hardware used to control signals and provide data to a computer or an information appliance. 
4 0
3 years ago
Other questions:
  • What is the Multiplier if the change in RGDP is $525,000,000 and initial spending is $100,000?
    12·1 answer
  • A(n) ____ backup only archives the files that have been modified since the last backup.
    11·1 answer
  • What are the main differences between a workgroup and a domain?
    14·2 answers
  • An increase in Consumption will ___________ in the Classical Model of Aggregate Demand.
    13·1 answer
  • When possible, you should avoid using _________ variables in a program?
    11·1 answer
  • Dustin runs a command at the command line trying to find out what kernel version the system is running. However, it doesn't give
    12·1 answer
  • Paul is playing a game when his computer shuts down unexpectedly. Paul has noticed recently that his fans are running very loud.
    13·1 answer
  • How is modern technology developed? Explain.
    14·2 answers
  • What is connected to the base unit in Desktop PC?
    14·1 answer
  • Hey everyone. I am so bored
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!