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
4vir4ik [10]
3 years ago
10

Write a statement that toggles the value of the bool variable onoffswitch. that is, if onoffswitch is false , its value is chang

ed to true ; if onoffswitch is true , its value is changed to false .
Computers and Technology
1 answer:
choli [55]3 years ago
8 0
You should state the language you're using in these types of questions; here's an example in C++.

bool onOff = true;
if (onOff)
onOff = false;
else
onOff = true;
You might be interested in
What is the name used for the camera’s view from a single position?
netineya [11]
A.A shot. 
hope this helps!!
5 0
3 years ago
Flashlights are known as which of the following
EastWind [94]
B. Battery powered lights
7 0
4 years ago
Read 2 more answers
What can I play to get max points
BaLLatris [955]

Answer:

H o e! (as the gardening tool)

3 0
3 years ago
Read 2 more answers
Write a function that computes the average and standard deviation of four scores. The standard deviation is defined to be the sq
ZanzabumX [31]

Answer:

#include<iostream>

#include<cmath>

using namespace std;

double calAvg(double s1, double s2,double s3, double s4);

double calStandardDeviation(double s1, double s2,double s3, double s4,double average,int n);

void main()

{

 double s1,s2,s3,s4;

double avg,StandardDeviation;

char option;

   do

{

 cout<<"Enter s1:";

 cin>>s1;

 cout<<"Enter s2:";

 cin>>s2;

 cout<<"Enter s3:";

 cin>>s3;

        cout<<"Enter s4:";

 cin>>s4;

 avg=calcAvg(s1,s2,s3,s4);

        sdeviation=calcStandardDeviation(s1,s2,s3,s4,avg,4);

 cout<<"Standard deviation:"<<sdeviation<<endl;

 cout<<"Do you want to continue then press y:";

         cin>>option;

}

       while (option='y');

}

double Average(double s1, double s2,double s3, double s4)

{

return (s1+s2+s3+s4)/4;

}

double calcStandardDeviation(double s1, double s2,double s3, double s4, double mean,int n)

{

double sd;

sd=(pow((s1-mean),2)+pow((s2-mean),2)+

                     pow((s3-mean),2)+pow((s4-mean),2))/n;

sd=sqrt(sd);

return sd;

}

7 0
3 years ago
"Using the printf method, print the values of the integer variables bottles and cans so that the output looks like this: Bottles
Anika [276]

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       

       System.out.println("Enter the number of bottles and cans:");

       int numberOfbottles = in.nextInt();

       int numberOfcans = in.nextInt();

       System.out.printf("Bottles: %8d\n", numberOfbottles);

       System.out.printf("Cans:    %8d\n", numberOfcans);

}

}

Explanation:

Ask user to input the number of bottles and cans using Scanner class

Print the results so that the numbers to the right line up (Since we know that the numbers have at most 8 digits, we can use %8d in printf. Also, be aware that how printf statements are written so that the numbers line up)

6 0
3 years ago
Other questions:
  • Sorts by value in reverse order; keeps the same key
    6·1 answer
  • True or False? A supervisory control and data acquisition (SCADA) device is a computer that controls motors, valves, and other d
    13·1 answer
  • Tables draw your attention to specific information in a spreadsheet. Please select the best answer from the choices provided T F
    10·1 answer
  • The _______ of a secondary storage device indicates how much data the storage medium can hold.
    13·1 answer
  • Saved
    5·1 answer
  • In PKI, the CA periodically distributes a(n) _________ to all users that identifies all revoked certificates.
    13·1 answer
  • C programming question
    6·1 answer
  • Logistic Regression is a type of __________ problem.
    13·2 answers
  • 36
    11·1 answer
  • A data analyst uses _____ to decide which data is relevant to their analysis and which data types and variables are appropriate
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!