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
Tanya [424]
3 years ago
12

Assume you have a variable sales of type Money where the latter is a structured type with two int fields, dollars and cents. Wri

te a statement that reads two integers from standard input, a dollar amount followed by a cents amount, and store these values in the appropriate fields in sales.
struct Money
{
int dollars,cents;
};

int x,y;
cin>>x>>y;
sales.dollars= x;
sales.cents= y;
Computers and Technology
2 answers:
7nadin3 [17]3 years ago
8 0

Answer:

The answer to the question is included in your question. I guess you need an explanation or clarification.

See Explanation Below

Explanation:

struct Money

{

int dollars,cents;

};

int x,y;

cin>>x>>y;

sales.dollars= x;

sales.cents= y;

The code segment is written in C++ programming language

On Line 1 of the code segment;

The struct keyword is used in c++ and other c type programming to define structure. The name of the structure is Money.

It defines a data type such that the data type is a collection of system and user defined data types

The Money structure defines two integer variables; dollars and cents on line 3.

On line 6, two integer variables x and y are declared.

On line 7, the two variables received inputs from the user.

On line 8, the value of variable x is assigned to dollar

On line 9, the value of variable x is assigned to cent

Nuetrik [128]3 years ago
3 0

Answer:

int x,y;

cin>>x>>y;

sales.dollars= x;

sales.cents= y;

Explanation:

The answer is already part of the question.

First, integer x and y is declared. Then, x and y is received via the standard input. Then x is assigned to sales.dollars while y is assigned to sales.cents.

You might be interested in
What is algorithm and how does it works​
andre [41]

Answer:

An algorithm, for the non-programmers among us, is a <u><em>set of instructions that take an input, A, and provide an output, B, that changes the data involved in some way</em>.</u> Algorithms have a wide variety of applications. In math, they can help calculate functions from points in a data set, among much more advanced things.

Explanation:

hope it helps

5 0
2 years ago
Read 2 more answers
How do you stop getting emails from brainly saying "sarah from brainly has answered your question"
Alina [70]

Answer:

One best way to prevent from getting some emails from Brainly that are a bit annoying when you get there notifications from there, here are some ways you can get rid of those notifications below;

At the More options icon you can press it and if you see the word unsubscribe you can press it. The picture above shows a part of the instruction. This more options icon is :

At the More options icon you can also press block and you will no longer receive a notification from this app. thats the best i can do Explanation:

3 0
2 years ago
SOLVE IN C:
RSB [31]

Answer:

#include <stdio.h>

#include <string.h>

int main(void) {

  char simonPattern[50];

  char userPattern[50];

  int userScore;

  int i;

  userScore = 0;

  scanf("%s", simonPattern);

  scanf("%s", userPattern);

  for(i = 0;simonPattern[i]!='\0';i++){

         if(simonPattern[i]!=userPattern[i]){

            userScore=i;

            break;

     }

  }

  printf("userScore: %d\n", userScore);

  return 0;

}

Explanation:

  • Use a for loop that runs until it does not reach the end of simonPattern.
  • Check whether the current index of simonPattern and userPattern are not equal and then assign the value of i variable to the userScore variable and break out of the loop.
  • Finally display the user score.
4 0
3 years ago
Write an expression that will cause the following code to print "Equal" if the value of sensorReading is "close enough" to targe
natali 33 [55]

Answer:

The C++ code is given below with appropriate comments

Explanation:

//Remove this header file if not using visual studio.

#include "stdafx.h"

//Include the required header files.

#include <iostream>

//Use for maths function.

#include <cmath>

using namespace std;

//Define main function

int main()

{

      // Define the variables

      double targetValue = 0.3333;

      double sensorReading = 0.0;

      //Perform the opeartion.

      sensorReading = 1.0 / 3.0;

      // Get the absolute floating point value and

      // Check up to 4 digits.

      if (fabs(sensorReading - targetValue) < 1E-4)

      {

             //Print equal if the values are close enough.

             cout << "Equal" << endl;

      }

      else

      {

             //Print not equal if the values are not                  

             //close enough.

             cout << "Not equal" << endl;

      }

      system("pause");

      //Return the value 0.

      return 0;

}

5 0
3 years ago
Your network employs basic authentication that centers on usernames and passwords. However, you have two ongoing problems. The f
Agata [3.3K]

Answer:

Using a one time password OTP and using a three factor authentication.

Explanation:

Social engineering is a form system and network attack, drafted by an attacker, to steal user credentials needed for accessing their accounts, to steal information.

Social engineering attacks like phishing, spear phishing, baiting and quid quo pro are used to fool users to giving out their user details.

One time password is an implied use of a password just once and a new password his generated to boost security. In a three factor authentication, OTP can be used as well as biometrics of a user which can not be giving away by a user to an attacker.

8 0
3 years ago
Other questions:
  • Ben assembled parts of a computer and created a fully functional desktop PC. He wants the computer to connect to the Internet. W
    10·1 answer
  • Robert needs to apply formatting from one set of text to multiple other sets of text throughout the document. Which option shoul
    7·1 answer
  • Match each item with a statement below. a device used in mobile devices to sense the physical position of the device an area whe
    11·1 answer
  • If you feel that an OSHA inspection is needed to get hazards corrected at your workplace, which is your best option?
    7·1 answer
  • In Windows Vista, the Run command can be found in which application?
    6·1 answer
  • A web page ____ can also create a style sheet that takes precedence over the internal style sheets of browsers.
    10·1 answer
  • What are three sections in a work sheet accounting
    12·1 answer
  • photoshop Curves, photoshop an image and manipulate the curves on a selection of the photo. upload the original photo and The ph
    5·2 answers
  • If you hard working right now go to this EASY question
    9·2 answers
  • Compare mini and mainframe computer in terms of speed,memory and storage​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!