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
Vera_Pavlovna [14]
3 years ago
11

Write a single if-test using Boolean operators and relaional operators to determine if a double variable x is between zero (excl

usive) and one (inclusive). Print a message indicating that x is between zero and one inclusive. Use deMorgan’s law to show the complement of the previous if-test. Simplify the complement statement so there is no "!" in your final if-test statement. 5. In the following questions, assume Boolean values have been assigned to A, B, and C as follows: boolean AA = true; boolean BB = false; boolean CC = true; Indicate what is printed by each statement: System.out.println( ((AA && BB) || (AA && CC)) ); System.out.println( ((AA || !BB) && (!AA || CC) ); 6. Write a program to determine if an input integer is an even number or odd number. 7. How can the effect of the following program fragment best be described? if (x > y) z = x; if (x == y) z = 0; if (x < y) z = y; a. The smaller of x and y is stored in z. b. The larger of x and y is stored in z. c. The larger of x and y is stored in z, unless x and y are equal, in which case z is assigned 0. d. The larger of x and y is stored in z, unless x and y are not equal, in which case z is assigned 0. e. None of the above.
Computers and Technology
1 answer:
Dahasolnce [82]3 years ago
3 0

Answer:

The following are the solution to this question:

Explanation:

In the given question multiple questions have been asked about, that is defined as follows:

#include<iostream>//defining header file

using namespace std;

int  main()//defining main method

{

  double x1;//defining double variable

  cout<<"enter value: ";//print message

  cin>>x1;//input value from the user-end

  if(x1>0 && x1<=1)//use boolean operators

  {

      cout<<"x is between zero and one";//print message

  }

  return 0;

}

Output:

enter value: 1

x is between zero and one

5)

public class Main//defining a class main

{

public static void main(String[] args) //defining main method

{

       boolean AA = true; //defining boolean variable  

       boolean BB = false;//defining boolean variable  

       boolean CC = true; //defining boolean variable

      if ((AA && BB) || (AA && CC)) //defining if block to check value

      {

         System.out.println("True");//print message

      }

      if ((AA || !BB) && (!AA || CC))//defining if block to check value

      {

         System.out.println("True");//print message

      }

   }

}

Output:

True

True

6)

#include <stdio.h>//defining header file

int main()//defining main method

{

   int x;

   printf("Enter a value: ");

   scanf("%d", &x);

   if (x%2==0)// check number

      {

       printf("Even number");//print message

      }

      else

      {

       printf("Odd Number");//print message

      }

   return 0;

}

Output:

Enter a value: 22

Even number

7)

The answer is "Option C".

In the first question, a double variable "x1"  is defined that inputs the value from the user end and use the boolean operators to check the value and print its value.

In question 5, three boolean variables "AA, BB, and CC" are defined that hold boolean value and use if block to check the given value.

In question 6, an integer variable has defined, that input the value and use if block to check even or odd number and print its value.

In question 7, option c is correct.

You might be interested in
Women make up 52 percent of the voting-age population and are more likely to vote, yet
NeX [460]
<span>Gender discrimination has been a prevalent issue that prevented a century of women not to participate.

Discrimination has become widespread nowadays ranging from gender discrimination, racial discrimination, work discrimination and many others.These types of discrimination are experienced by almost all people everyday without them even knowing it. Some discrimination lies behind a sweet smile and an accommodating eyes and in order to defend yourself against this discrimination you need to load up yourself of a lot of self confidence.</span>
3 0
3 years ago
Read 2 more answers
How to make a slideshow out of pictures in a folder windows not fitting to screen?
weqwewe [10]

Answer:

Windows slideshow.

Explanation:

Creating or displaying a collection of images in a windows file can be very ecstatic and it is quite possible using third party applications.

One way of creating a slideshow is using the screensaver desktop option. There are other easy ways like the wallpaper option and using powerpoint presentation.

To using the screensaver option, go to windows settings and click on personalize, here, use can select a theme or a group of image files, click on a color theme and click apply.

8 0
4 years ago
Write the working of dot matrix printer?<br><br>no links<br>​
lbvjy [14]

The working of dot matrix printer is provided in the picture.

4 0
3 years ago
Maria is starting a pet hotel and needs a website to promote her business and establish her brand. Which of the following is the
german

<em>The answer is </em><em>C. Maria should use turnkey solution that will allow her to use templates and management tools to create a site. </em>

<em> </em>

<em>Turnkey solution</em><em> is a type of business solution that can allow business owners to use these ready-made tools, templates and system to their existing process and business operations. Such tools include </em><em>CRM </em><em>and websites. For example, you are in need of a Loans Management System, that must be implemented next week. You can browse for Loans CRM that are widely available on the internet, subscribe to the service, make payment and this could be used right away in your business operation. Same thing with Maria's needs on the website. She could just subscribe to a website that can allow her to create pages and links with drag and drop and make it running right away.</em>

8 0
3 years ago
Write a c program to count the total number of commented characters and words in a c file taking both types of c file comments (
Tanzania [10]

#include<stdio.h>

#include<stdlib.h>

int comment1(FILE *fp)

{

   char ch;

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='\n')

       {

           return count;

       }

       count++;

   }

   return count;

}

int comment2(FILE *fp)

{

   char ch;

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='*')

       {

           fscanf(fp,"%c",&ch);

           if(ch=='/')

           {

               return count;

           }

           count++;

       }

       count++;

   }

   return 0;

}

int main()

{

   printf("Enter the file name:");

   char s[1000],ch,ch1;

   scanf("%s",s);

   FILE*fp;

   fp = fopen(s,"r");

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='\"')

       {

           while(fscanf(fp,"%c",&ch)!=EOF)

           {

               if(ch=='\"')

               {

                   break;

               }

               if(ch=='\\')

               {

                   fscanf(fp,"%c",&ch);

               }

           }

       }

       else if(ch=='/')

       {

           fscanf(fp,"%c",&ch);

           if(ch=='/')

           {

               count += comment1(fp);

           }

           else if(ch=='*')

           {

               count += comment2(fp);

           }

       }

   }

   printf("%d\n",count);

   return 0;    

}

3 0
3 years ago
Read 2 more answers
Other questions:
  • What is heat sink?what is its use?If it is not in the system what will happen?
    12·1 answer
  • . Write a recursive function names factorial to compute the factorial of the parameter. Also write the main function, where you
    15·1 answer
  • Write a function that, given an array of integers and its size, reverses the elements in the array. For example, if the original
    13·1 answer
  • A malicious program that can replicate and spread from computer to computer?
    10·2 answers
  • In information security, a specification of a model to be followed during the design, selection, and initial and ongoing impleme
    5·1 answer
  • ______________ memory is a small, high-speed, high-cost memory that servers as a buffer for frequently accessed data
    9·2 answers
  • Cuales fueron las consecuencias que creo el storm worm (gusano storm, el informatico)??
    5·1 answer
  • An online news website relies on in-page advertisements to make money. Their article pages have multiple slots for advertisement
    5·1 answer
  • Which situation is the best choice for using telehealth?
    12·1 answer
  • A _____ consists of horizontal bars, connected with arrows that indicate task dependencies.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!