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
Zina [86]
3 years ago
7

You will write a flowchart and C code for a program that does the following:Call three functions from main(). The functions are

named first(), second(), and third(). Each function prints out its name ("first," "second," "third."). After all three functions are called, the main() function should print "End of program."
Computers and Technology
1 answer:
Vitek1552 [10]3 years ago
8 0

Answer:

#include <stdio.h>

void first() {

   printf("first\n");

}

void second() {

   printf("second\n");

}

void third() {

   printf("third\n");

}

int main() {

   first();

   second();

   third();

   printf("End of program.\n");

   return 0;

}

You might be interested in
Traditional methods of business communication tend to mean paper-based messages such as formal letters, brochures, reports, prop
Mila [183]

Traditional methods of business communication tend to mean paper-based messages such as formal letters, brochures, reports, proposals, and notes.

There is no denying the fact that digital communication has a lot more advantages as compared to the traditional methods of business communication, but there are certain cases and situations where traditional methods and preferred over digital communication.

Paper-based messages provide objective evidence that a formal undertaking has been issued. The advantage of paper-based messages is that they can't be tampered with and not reproduced. They represent the signature of the concerned authority and are always treated above the digital signatures.

5 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
A short cut to save a file is
Vanyuwa [196]

Answer:

CTRL+S in most programs

8 0
2 years ago
Consider the following general code for allowing access to a resource:
Margaret [11]

Answer:

a) The code allows access even when  IsAccessAllowed(...) method fails.

b) Either use If

(dwRet = ACCESS_ALLOWED)

or use

if (dwRet == NO_ERROR)

to avoid flaw

Explanation:

Lets first see what the code chunk does:

DWORD dwRet = IsAccessAllowed(...);

if (dwRet == ERROR_ACCESS_DENIED) {

// Security check failed.

// Inform user that access is denied.

} else {

// Security check OK.

}

In the given code, DWORD is basically a data type for double word type integers and this is defined in windows.h

So there is DWORD type variable dwRet that is assigned a method calls.

The method is IsAccessAllowed() which checks if the access is allowed to user.

if (dwRet == ERROR_ACCESS_DENIED) condition basically checks if the value of DWORD type variable dwRet is equal to ERROR_ACCESS_DENIED

If this condition evaluates to true then the security checks fails and user is informed via some message or action that the access is denied.  But when the if condition evaluates to false then the else part executes which allows access.

So basically this chunk of code checks if the error ERROR_ACCESS_DENIED is returned.

Now the flaw in this program is what if the method IsAccessAllowed() by any reason. The reasons can be system failure or the memory failure. In memory failure case for example, the system returns out of memory error. So this means that the error is not  ERROR_ACCESS_DENIED. Instead it is out of memory error. So in such a case the user is allowed access as the if condition evaluates to false and else part executes. So if any other error is produced due to some reason like mentioned above, then user has unrestricted access.

This shows that the doe should not check for the failure or rely on checking ERROR_ACCESS_DENIED to allow access but instead it should check for success. Code should only give access privilege if access is allowed successfully or no error is produced.

So to avoid this flaw the code is altered as:

DWORD dwRet = IsAccessAllowed(...);

If (dwRet = ACCESS_ALLOWED) {

//Security check OK.

} else {

//Security check failed.

//Inform user that access is denied.

}

This will only allow access if ACCESS_ALLOWED evaluates to true and success is checked instead of failure here

You can also alter the if condition as:

If (dwRet = No_Error)

or

If (dwRet = 0)

The above if conditions checks if the access is allowed or if no error is produced. Only then it will allowed access otherwise not. So the access check is a success is checked first and failure (for any reason). The user is allowed access only if there is no error otherwise user is not allowed access.

6 0
3 years ago
I need some help pleas hurry
Alexandra [31]
Opinion is the answer, every thing else can be compared with the data
8 0
2 years ago
Other questions:
  • What are 2 ways that technology can negatively impact the environment.
    8·2 answers
  • How are engineers are related to technology
    13·1 answer
  • Excel supports all of the following types of sparklines except ____.
    13·1 answer
  • What is the difference between a sequential program and an event-driven program?
    9·1 answer
  • Because it takes time to change an organization’s culture, the ISO must continually monitor security policy compliance. The ISO
    9·1 answer
  • Before its final commercial release, a(n) ________ version of software may be offered to certain test sites or to interested use
    6·1 answer
  • What is the FTC used car rule
    12·1 answer
  • The
    6·2 answers
  • True or False <br><br> Rootkits are only made by black-hat hackers.
    8·1 answer
  • The base 10 number 18 is equal to which base 16 number?<br><br> 10<br><br> 12<br><br> 14<br><br> 16
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!