
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
![Write code that uses the input string stream inSS to read input data from string userlnput, and updates variables userMonth,
userDate, and userYear. Sample output if the input is "Jan 12 1992":
Month: Jan
Date: 12
Year: 1992
import java.util.Scanner;
public class StringInputStream {
public static void main (String [] args) {
Scanner scnr = new Scanner (System.in);
Scanner inSs = null;
String userInput;
String userMonth;
int userDate;
int userYear;
userInput
scnr.nextLine () ;
inss
new Scanner (userInput);
/* Your solution goes here
* /
System.out.println ("Month:
+ userMonth);
System.out.println ("Date:
+ userDate);
System.out.println ("Year:
+ userYear);
}
}](https://content.bartleby.com/qna-images/question/5cd8bee2-43ef-45e5-b232-3a158906255f/874bbd57-a5f4-45e9-bb89-d8bb4b87f63f/icf7meq_thumbnail.png)
Transcribed Image Text:Write code that uses the input string stream inSS to read input data from string userlnput, and updates variables userMonth,
userDate, and userYear. Sample output if the input is "Jan 12 1992":
Month: Jan
Date: 12
Year: 1992
import java.util.Scanner;
public class StringInputStream {
public static void main (String [] args) {
Scanner scnr = new Scanner (System.in);
Scanner inSs = null;
String userInput;
String userMonth;
int userDate;
int userYear;
userInput
scnr.nextLine () ;
inss
new Scanner (userInput);
/* Your solution goes here
* /
System.out.println ("Month:
+ userMonth);
System.out.println ("Date:
+ userDate);
System.out.println ("Year:
+ userYear);
}
}
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Please use Replit to complete in C programming language. PLEASE FOLLOW guidelines CLOSELY AND SHOW OUTPUTSarrow_forwardThis is for r Regarding a for loop, which of the following is not true? The for keyword must be followed by parentheses. Following the for statement, the code to be executed is recognized by it being indented. The number of times the loop will be performed is determined by the length of the vector passed to the for keyword. The for loop can contain other for loops.arrow_forwardplease help on this python problem, produce new codarrow_forward
- 9b_act2. Please help me answer this in python programming.arrow_forwardTime Write a Python script that extracts and prints a single record from an input file in which organized by line. Each line contains the name of a person (possibly containing multiple followed by the year of his birth. Abbas ibn Firnas ibn Wirda: 809 Muhammad ibn Musa al - Khwarizmi: 780 Abu Al - Walid Muhammad Ibn Ahmad Rushd: 1126 The program uses function extract DataRecord with the specification: @param infile the input text file object @return pants a list containing the name (string) in the first element and the year of bir the second element. If the end of file was reached, an empty list is returnedarrow_forwardCISP 1010, Lab 3, Arrays and C-Strings Introduction This application creates Mad Lib™ haikus based upon user input. Detailed Information The application reads three-line haikus into a two-dimensional array of characters (an array of C-strings, not C++ string objects) from an input file called haikus.dat. Do not ask the user for this file name. Just open it and read its contents into a two-dimensional array. A sample input file with two haikus is shown below. Flowers sit in * Shades of the * tree near * in sunset When begins the * And the * Crocus blooms * any thing The asterisk will actually be in the file. They indicate where words that the user enters go in the haiku. The asterisk on the first line will be replaces by a one syllable noun and on the second line will be replaced by a two syllable adjective. These two askterisks will never be the first character of the line. The asterisk on the third line will always be the first character on the line and will be replaced by a gerund (a…arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education