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
diamong [38]
3 years ago
6

In a C++ program, one and two are double variables and input values are 10.5 and 30.6. After the statement cin >> one >

> two; executes, ____.
Computers and Technology
1 answer:
SSSSS [86.1K]3 years ago
6 0

Answer:

variable one stores 10.5 and two stores 30.6

Explanation:

In c++ language, the cout keyword is used to write to the standard output. The input from the user is taken by using the cin keyword.

For the input from the user, a variable need is declared first.

datatype variable_name;

The input can be taken one at a time as shown.

cin >> variable_name;

The input for more than one variable can be taken in a single line as given by the syntax below.

1. First, two variables are declared.

datatype variable_name1, variable_name2;

2. Both input is taken simultaneously as shown.

cin >> variable_name1, variable_name2;

For the given scenario, two double variables are declared as below.

double one, two;

The question mentions input values for the two double variables as 10.5 and 30.6.

3. The given scenario takes both the values as input at the same time, in a single line as shown below.

cin >> one >> two;

4. After this statement, both the values entered by the user are accepted.

The values should be separated by space.

First value is stored in the variable one.

Second value is stored in the variable two.

5. The user enters the values as follows.

10.5 30.6

6. The value 10.5 is stored in variable one.

7. The value 30.6 is stored in variable two.

The c++ program to implement the above is given below.

#include <iostream>

using namespace std;

int main() {

   double one, two;      

   cout << " Enter two decimal values " << endl;

   cin >> one >> two;

   cout << " The input values are " << endl;

   cout << " one : " << one << " \t " << " two : " << two << endl;

   return 0;

}

OUTPUT

Enter two decimal values  

10.5 30.6

The input values are  

one : 10    two : 530.6

You might be interested in
The Security Development Life Cycle (SDLC) is a general methodology for the design and implementation of an information system.
navik [9.2K]

Answer:

False

Explanation:

The Security Development Life Cycle (SDLC), is a software development which involves traditional approach towards its design such as, waterfall model, Agile, etc.

It can either be referred to as a generic secure development life cycle or a specific one, such as the Microsoft SDL or the Cisco SDL.

Its phases includes,

A1 - Security Assessment

A2 - Architecture

A3 - Design and Development 1

A4 - Design and Development 2

A5 - Ship

PRSA - Post Release

Each phase talks about how a secured software is developed.

The Security Development Life Cycle (SDLC) is a general methodology for the design and implementation of an information system. This statement is false because by definition and attributes Security Development Life Cycle is a traditional approach towards software development and not a general method.

6 0
2 years ago
If you have a mix of 32-bit and 64-bit versions of windows, which architectures should you add a unattended installation file fo
umka21 [38]
64 bit the likely hood of it failing is much less
4 0
3 years ago
Write a (one) program for your microcontroller so that it:
AleksandrR [38]

Answer:

see explaination

Explanation:

1.) Each time the main program execution starts at address 0000 - Reset Vector. The address 0004 is “reserved” for the “interrupt service routine” (ISR).

ORG 0x000 ; processor reset vector

goto main ; go to beginning of main program

ORG 0x004 ; interrupt vector location

movwf w_temp ; save off current W register contents

movf STATUS,w ; move status register into W register

movwf status_temp ; save off contents of STATUS register

.

.

RETFIE

main

3.) Push button switch is connected to the first bit of PORT B (RB0) which is configured as an input pin. When the switch is pressed this pin RB0 will be grounded. The LED is connected to the first bit of PORT B (RA0)

4.) Push button switch is connected to the first bit of PORT B (RB0) which is configured as an input pin. When the switch is pressed this pin RB0 will be grounded. The LED is connected to the first bit of PORT B (RA0)

5.) Push button switch is connected to the first bit of PORT B (RB0) which is configured as an input pin. When the switch is pressed this pin RB0 will be grounded. The LED is connected to the first bit of PORT B (RA0)

#include <stdio.h>

#include <stdlib.h>

#define _XTAL_FREQ 800000//Declare internal OSC Freq as 8MHz

#include <xc.h>

#include<pic.h>

CONFIG(FOSC_INTOSCIO & WDTE_OFF & PWRTE_OFF & MCLRE_ON & BOREN_OFF & LVP_OFF & CPD_OFF & WRT_OFF & CCPMX_RB0 & CP_OFF);

CONFIG(FCMEN_ON & IESO_ON);

unsigned int count=0;

main()

{

TRISA=0;//Sets all ports on A to be outputs

TRISB=1;//Sets all ports on B to be inputs

for(;;){

if(PORTBbits.RB0==1){//When the button is pressed the LED is off

PORTAbits.RA1 =0;

count=count+1;

}

else {

PORTAbits.RA1=1;

count = count +1;

}

if (count > 6){//if count =6 i.e 6 times button presses the RED LED turns on

PORTAbits.RA0=1;

}

else{

PORTAbits.RA0=0;

}

}

}

#include <stdio.h>

#include <stdlib.h>

#define _XTAL_FREQ 800000//Declare internal OSC Freq as 8MHz

#include <xc.h>

#include<pic.h>

CONFIG(FOSC_INTOSCIO & WDTE_OFF & PWRTE_OFF & MCLRE_ON & BOREN_OFF & LVP_OFF & CPD_OFF & WRT_OFF & CCPMX_RB0 & CP_OFF);

CONFIG(FCMEN_ON & IESO_ON);

unsigned int count=0;

main()

{

TRISA=0;//Sets all ports on A to be outputs

TRISB=1;//Sets all ports on B to be inputs

for(;;){

if(PORTBbits.RB0==1){//When the button is pressed the LED is off

PORTAbits.RA1 =0;

count=count+1;

}

else {

PORTAbits.RA1=1;

count = count +1;

}

if (count > 8){//if count =8 i.e 8 times button presses the RED LED turns on

PORTAbits.RA0=1;

}

else{

PORTAbits.RA0=0;

}

}

}

#include <stdio.h>

#include <stdlib.h>

#define _XTAL_FREQ 800000//Declare internal OSC Freq as 8MHz

#include <xc.h>

#include<pic.h>

CONFIG(FOSC_INTOSCIO & WDTE_OFF & PWRTE_OFF & MCLRE_ON & BOREN_OFF & LVP_OFF & CPD_OFF & WRT_OFF & CCPMX_RB0 & CP_OFF);

CONFIG(FCMEN_ON & IESO_ON);

unsigned int count=0;

main()

{

TRISA=0;//Sets all ports on A to be outputs

TRISB=1;//Sets all ports on B to be inputs

for(;;){

if(PORTBbits.RB0==1){//When the button is pressed the LED is off

PORTAbits.RA1 =0;

count=count+1;

}

else {

PORTAbits.RA1=1;

count = count +1;

}

if (count > 10){//if count =10 i.e 10 times button presses the RED LED turns on

PORTAbits.RA0=1;

}

else{

PORTAbits.RA0=0;

}

}

}

6 0
3 years ago
Is this statement true or false? Title text boxes on every slide must be the same format. True false.
RUDIKE [14]

Answer:

start with what you know

Explanation:

5 0
2 years ago
Read 2 more answers
A technician is using a network-attached desktop computer with a Type 2 hypervisor to run two VMs. One of the VMs is infected wi
lianna [129]

Answer:

Place both VMs on virtual NICs that are isolated from the company LAN.

Explanation:

From the scenario above, for the technician to best protect the company's LAN while performing the above mentioned tests, it us best to place both VMs on virtual NICs that are isolated from the company LAN.

Cheers

4 0
3 years ago
Other questions:
  • In a program called Nature's Notebook, citizen volunteers make and report observations about seasonal changes in plants and anim
    15·1 answer
  • In general terms, a program that is broken into smaller units of code such as methods, is known as a ________
    6·1 answer
  • . char values are surrounded by _____ quotes
    15·1 answer
  • What is parallelism of microinstruction
    9·1 answer
  • Define a function CoordTransform() that transforms the function's first two input parameters xVal and yVal into two output param
    12·1 answer
  • --------------------is a host that runs software to provide information, such as web content, to other hosts.
    9·1 answer
  • A beginning driver may tend to oversteer. This means the driver what? Btw Cars are technology so that is why it is under Compute
    11·1 answer
  • A new company will have 40 workstations in one building sharing a single network. All users must be able to share ¬les and print
    7·1 answer
  • 5.During a recent network attack, a hacker used rainbow tables to guess network passwords. Which type of attack occurred
    9·1 answer
  • If Laura wanted to solve a problem using recursion where the last statement executed is the call to the same method, what type o
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!