answer.
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
erastovalidia [21]
2 years ago
10

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 userinput is "jan 12 1992":
Computers and Technology
2 answers:
Savatey [412]2 years ago
4 0

Answer:

The solution code is written in C++

  1.    string usermonth;
  2.    int userdate,useryear;
  3.    
  4.    string userinput = "jan 12 1992";
  5.    istringstream inss;
  6.    inss.str(userinput);
  7.    
  8.    inss>> usermonth>>userdate>>useryear;
  9.    
  10.    cout<<usermonth<<" "<<userdate<<" "<<useryear;

Explanation:

Firstly, declare three variables, <em>usermonth, userdate and useryear </em>(Line 1-2).

Next declare another variable <em>userinput</em> to hold the input string (Line 4). Create an input string object,<em> inss</em> (Line 5) that can read the input string (Line 6). Once the input string is read into inss, we can use >> operator to update variable <em>usermonth, userdate, </em>and <em>useryear</em> (Line 8).

We print the value of <em>usermonth, userdate, </em>and <em>useryear</em> at console terminal (Line 10) and we shall get:

jan 12 1992

mr Goodwill [35]2 years ago
3 0

Answer:

It will be a java code.

Explanation:

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  */

        System.out.println("Month: " + userMonth);

        System.out.println("Date: " + userDate);

        System.out.println("Year: " + userYear);

        return;

   }

}

You might be interested in
Given an n-element array X, algorithm D calls algorithm E on each element X[i]. Algorithm E runs in O(i) time when it is called
krek1111 [17]

Answer:

O(n^2)

Explanation:

The number of elements in the array X is proportional to the algorithm E runs time:

For one element (i=1) -> O(1)

For two elements (i=2) -> O(2)

.

.

.

For n elements (i=n) -> O(n)

If the array has n elements the algorithm D will call the algorithm E n times, so we have a maximum time of n times n, therefore the worst-case running time of D is O(n^2)  

5 0
2 years ago
Following are groups of three​ phrases, which group states three ways to improve your​ concentration?
andreev551 [17]
I believe its <span>c-set up a study​ space, preview your​ materials, create a routine</span>
3 0
1 year ago
In database software, a record is a
Rzqust [24]

Answer:

In database software a record is a group of related data held within the same structure.

4 0
2 years ago
Given the macro definition and global declarations shown in the image below, provide answers to the following questions:
galben [10]

Answer:

A. 243

B. True

C. 0

Explanation:

Macro instruction is a line of coding used in computer programming. The line coding results in one or more coding in computer program and sets variable for using other statements. Macros allows to reuse code. Macro has two parts beginning and end. After the execution of statement of quiz4 x, 4 the macro x will contain 243. When the macro is invoked the statement will result in an error. When the macro codes are executed the edx will contain 0. Edx serve as a macro assembler.

4 0
1 year ago
Write a method for the Customer class that that will return a string representing a bill notice when passed a double value repre
Nesterboy [21]

Answer:

Following are the method definition to this question:

public String notice_bill(double amount) //defining method

{

return this.name+", account number "+this.currAccNum+", please pay $"+amt;  //return value.

}

Explanation:

In the given question some information is missing, that is example So, method definition to this question can be described as follows:

  • In the above method definition a string method "notice_bill" is declared, which accepts a double value in its parameter, that is "amount".
  • Inside the method, this keyword is used, that hold values and return its value as a message.  
5 0
1 year ago
Other questions:
  • Write the definition of a function dashedline, with one parameter , an int . if the parameter is negative or zero, the function
    15·1 answer
  • Which statements describe the advantages of using XML?
    12·2 answers
  • Blender questions
    8·2 answers
  • Deanna wants to have an exciting presentation and adds animations. She wants her bullet points to be animated through motion. Wh
    5·2 answers
  • When ____ occur during preliminary debugging, dummy print statements—statements that are temporarily inserted into the code to d
    9·1 answer
  • When trying to improve performance of a slow system, you notice in Task Manager that the superfetch service is using a high perc
    11·1 answer
  • Suggest how the following requirements might be rewritten in a quantitative way. You may use any metrics you like to express the
    7·1 answer
  • A variable like userNum can store a value like an integer. Extend the given program to print userNum values as indicated. (1) Ou
    15·1 answer
  • What is Accenture's role in Multi-party Systems?
    12·1 answer
  • How does Accenture help companies harness the power of data to achieve optimal business outcomes?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!