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
myrzilka [38]
4 years ago
8

Write code that uses the input string stream inSS to read input data from string userInput, and updates variables userMonth, use

rDate, and userYear. Sample output if the input is "Jan 12 1992": Month: Jan Date: 12 Year: 1992
Computers and Technology
1 answer:
Lostsunrise [7]4 years ago
3 0

The Code Looks Like this :

import java.util.Scanner;
public class StringInputStream {
public static void main (String [] args) {
Scanner inSS = null;
String userInput = "Jan 12 1992";
inSS = new Scanner(userInput);
String userMonth = "";
int userDate = 0;
int userYear = 0;
/* Your solution goes here */
inSS.useDelimiter(" ");
userMonth=inSS.next();
userDate=inSS.nextInt();
userYear=inSS.nextInt();
System.out.println("Month: " + userMonth);
System.out.println("Date: " + userDate);
System.out.println("Year: " + userYear);
return;
}
}

Out Put:

Month: Jan

Date: 12

Year: 1992
You might be interested in
Hello can you please help with this if you want to thank you!
nikklg [1K]

Answer:

hardware and software is the answer

8 0
3 years ago
Read 2 more answers
Repayment of a direct plus loan begins:
just olya [345]
The answer is D I hope i'm right


4 0
4 years ago
Read 2 more answers
3. Program to find the sum of all even numbers from m to n, where m and n
Gnom [1K]

Answer: M and E

Explanation: Hope this helps

8 0
3 years ago
Write a program which asks the user to enter N numbers. The program will print out their average. Try your program with the foll
Likurg_2 [28]

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables

int n;

double average,sum=0,x;

cout<<"enter the Value of N:";

// read the value of N

cin>>n;

cout<<"enter "<<n<<" Numbers:";

// read n Numbers

for(int a=0;a<n;a++)

{

   cin>>x;

   // calculate total sum of all numbers

   sum=sum+x;

}

// calculate average

average=sum/n;

// print average

cout<<"average of "<<n<<" Numbers is: "<<average<<endl;

return 0;

}

Explanation:

Read the total number from user i.e "n".Then read "n" numbers from user with for loop and sum them all.Find there average by dividing the sum with n.And print the average.

Output:

enter the Value of N:5

enter 5 Numbers:20.5 19.7 21.3 18.6 22.1

average of 5 Numbers is: 20.44

7 0
4 years ago
Hi guys help me plz . How to get ios 10 zip file for android devices ? or how to port ios 10 or higher for htc one me ?
Vladimir79 [104]
While you set up your new iOS device, look for the Apps & Data screen. Then tap Move Data from Android. (If you already finished setup, you need to  erase your iOS device and start over. If you don't want to erase, just transfer your content manually<span>.)</span>
4 0
3 years ago
Other questions:
  • Shirley was unsure about what career to go into. Her high school counselor suggested a personal assessment to point out Shirley’
    12·2 answers
  • Kai is a software engineer who started his own IT consulting firm. His friend, Catalina, is the owner of a store that sells offi
    13·2 answers
  • Modify your solution to Problem 8.24 so that one (and only one) child installs a Segmentation-fault handler which prints an erro
    10·1 answer
  • How do you take apart a I pad and put it back together and it still works
    5·1 answer
  • Quantas calorias os adolescentes devem consumir diariamente?
    14·1 answer
  • PLEASE HELP FAST
    5·1 answer
  • What settings are available in the Properties dialog box of a message? Check all that apply.
    6·2 answers
  • Which type of software is for sale directly to consumers in stores and online?
    6·1 answer
  • Difference between customized and packaged software​
    10·1 answer
  • How does the dns solve the problem of translating domain names like example.com into ip addresses?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!