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
Yakvenalex [24]
2 years ago
9

Write an if/else statement that assigns 0 to x when y is equal to 10; otherwise it should assign

Computers and Technology
1 answer:
Liono4ka [1.6K]2 years ago
7 0

Answer:

if(y==10)

{

     x=0;   // assigning 0 to x if y equals 10.

}

else

{

   x=1;   // assigning 1 to x otherwise.

}

Explanation:

In the if statement i have used equal operator == which returns true if value to it's right is equal to value to it's left otherwise false.By using this operator checking value of y and if it is 10 assigning 0 to x and if it is false assigning 1 to x.

You might be interested in
Explain program and programming with two examples of each<br>Help​
evablogger [386]

Answer:

program (noun) is executable software that runs on a computer. ... Examples of programs include Web browsers, word processors, e-mail clients, video games, and system utilities. These programs are often called applications, which can be used synonymously with "software programs." On Windows, programs typically have an .

7 0
3 years ago
You and a few friends are having a meal at a pizza restaurant, and the server has just given you the bill. Write a function that
cestrela7 [59]

Answer:

How to calculate the total cost of the meal

For bill inclusive of tax, cost1=cost*(1+tax percentage)

For bill inclusive of tax and tip, cost2=cost1*(1+tip percentage)

Meal cost =(pizza cost*(1+tax percentage))*(1+tip percentage)

Now how to calculate the cost per person

cost per person=meal cost/ number of people.

C language code to solve the above problem is given below with appropriate comments for explanation

Explanation:

#include<stdio.h>

float split_bill(int cost,float tax)

{

//Declaring number of people as int

int number;

//Prompting for number of people

printf("Enter number of people ");

scanf("%d",&number);

//Declaring tip percentage as float

float tip_percent;

//Prompting for tip percentage

printf("Enter tip percentage between 0 and 1 ");

scanf("%f",&tip_percent);

//Calculating total meal cost

float meal=(((float)cost)*(1+tax))*(1+tip_percent);

//Printing total cost of meal

printf("Total cost of meal: %0.2f ",meal);

//Calculating cost per person

float cost_per_person=meal/number;

//Returning cost per person to main function

return cost_per_person;

}

int main()

{

//Declaring pizza cost as int and tax percentage as float

int pizza_cost;

float tax_percent;

//Prompting user for pizza cost

printf("Enter billing amount of pizza ");

scanf("%d",&pizza_cost);

//Prompting user for tax percentage

printf("Enter tax percentage between 0 and 1 ");

scanf("%f",&tax_percent);

//Printing the cost per person by calling the function split_bill

printf("Total cost per person is: %0.2f ",split_bill(pizza_cost,tax_percent));

return 0;

}

8 0
2 years ago
Part B - Find the solutions for the following Case Study Real World Problems by applying the appropriate concepts that you learn
Monica [59]

Answer:

ok very surprised to hear that

5 0
3 years ago
Which slot type would you install a video card in to get the best performance?
erma4kov [3.2K]
It really is hard to say because there are many slots and we do not know what your teacher is teaching. I have seen a lot of teachers teaching out of date material. With that said, here is a list from best to worst.

PCI Express x16
PCI Express x1
AGP
PCI

This is list is based on greatest to least and base on the bandwidth read and write speed.

6 0
2 years ago
the impact of the global digital divide. According to the authors, countries that lag behind the rest of the world’s ICT capabil
kvasek [131]

Answer:

hi

Explanation:

5 0
2 years ago
Other questions:
  • A plan to budget time for studying and activities is referred to as
    15·1 answer
  • What acronym describes networked devices that contain microcomputers but are not thought of as computing devices, such as refrig
    9·1 answer
  • Assume that the following variables have been defined in a program: int x = 10; int y = 20; int z = 30; Write a cout statement t
    11·1 answer
  • What type of function is being performed when a router screens packets based on information in the packet header
    8·1 answer
  • Explain two ways by which the calendar meets or fails to meet the criteria of showing the correct data
    7·1 answer
  • What symbol indicates that material has been copyrighted?
    8·2 answers
  • Will give 5 star and the mark brainleist
    11·2 answers
  • What does the top level domain in a url inducate? A. The organization or company that owns the website. B. The organization or c
    6·2 answers
  • Role of User Defined Iprms for creation of paten
    8·1 answer
  • A good algorithm should have which three components?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!