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
An attacker distributes hostile content on Internet-accessible Web sites that exploit unpatched and improperly secured client so
julia-pushkina [17]

Answer:

Since the attack impacts the client SANS Critical Security Controls. This act affects the Inventory of authorized and unauthorized software running on the victim's machine.

5 0
2 years ago
Read 2 more answers
Jonah’s friend reminded him to check his report against the rubric provided by their teacher. His friend sent him these instruct
Semenov [28]

Answer:

Steps 2 and 3 needs to be switched.

Explanation:

e2020

8 0
2 years ago
If there are 8 opcodes and 10 registers, a. What is the minimum number of bits required to represent the OPCODE? b. What is the
Nimfa-mama [501]

Answer:  

For 32 bits Instruction Format:

OPCODE   DR               SR1                   SR2      Unused bits

a) Minimum number of bits required to represent the OPCODE = 3 bits

There are 8 opcodes. Patterns required for these opcodes must be unique. For this purpose, take log base 2 of 8 and then ceil the result.

Ceil (log2 (8)) = 3

b) Minimum number of bits For Destination Register(DR) = 4 bits

There are 10 registers. For unique register values take log base 2 of 10 and then ceil the value.  4 bits are required for each register. Hence, DR, SR1 and SR2 all require 12 bits in all.  

Ceil (log2 (10)) = 4

c) Maximum number of UNUSED bits in Instruction encoding = 17 bits

Total number of bits used = bits used for registers + bits used for OPCODE  

     = 12 + 3 = 15  

Total  number of bits for instruction format = 32  

Maximum  No. of Unused bits = 32 – 15 = 17 bits  

OPCODE                DR              SR1             SR2              Unused bits

  3 bits              4 bits          4 bits           4 bits                17 bits

7 0
2 years ago
Can you find the reason that the following pseudocode function does not return the value indicated in the comments? // The calcD
Alexus [3.1K]

Answer:

see explaination

Explanation:

Function Real calcDiscountPrice(Real price, Real percentage) // Calculate the discount.

Declare Real discount= (price * percentage) / 100.0 // Subtract the discount from the price.

//dividing by 100.0 because of % concept

Declare Real discountPrice = price - discount // Return the discount price.

Return discount End Function

5 0
2 years ago
Explain why each of the following names does or does not seem like a good variable name to represent a state sales tax rate.
tatyana61 [14]

a. stateTaxRate  - A good variable name because it represents what it holds, the state sales tax rate, without being too wordy. Also correctly capitalized in camelcase.

b. txRt  - A bad variable name because while short and simple, it is too hard to understand what the variable represents.

c. t  - A very bad variable name if you plan on using the variable often. Far too short and you will forget what it represents and is needed for.

d. stateSalesTaxRateValue  - A bad variable name because it is just too wordy. Cutting it down to A's variable name is much more reasonable

e. state tax rate  - A bad variable name and probably invalid because it has spaces in the name.

f. taxRate  - A good variable name if there are no other tax calculations other than state tax rate. Otherwise you would confuse state vs local tax rate or something, making it a bad variable name.

g. 1TaxRate  - A bad variable name because the number 1 has no reason being in the variable name. It doesn't add anything to the name.

h. moneyCharged - A bad variable name because it is not specific enough in explaining why the money is being charged and what for.

7 0
2 years ago
Other questions:
  • Which presenter would most likely benefit from a custom slide show?
    10·2 answers
  • Which are examples of copyrighted online materials? Check all that apply.
    14·2 answers
  • if you had two proxy servers located in the same room, what use could you make of them? nothing create a hub sell one of the ser
    14·2 answers
  • Mathematical computations by a computer are faster than your quickest mathematical computations because the top speed of a neura
    13·1 answer
  • You are attempting to open a file containing a list of integer numbers, each on a separate line, and read them into Python as in
    6·1 answer
  • In cell M2, enter a formula using a nested IF function as follows to determine first if a student has already been elected to of
    12·1 answer
  • Performing binary search on an unsorted list will always return the correct answer in O(n) time where n is the length of the lis
    9·1 answer
  • Write code that determines the number of full days represented by the number of hours stored in the variable hours and stores th
    15·1 answer
  • A school principal trying to find out if parents will help buy new playground equipment shows digital leadership by.
    8·2 answers
  • The word “computer” has become associated with anything related to screens and keyboard. However, these are not the only parts t
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!