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
alukav5142 [94]
3 years ago
15

Write a C program that includes a function of type double called divemaster accepts two double arguments (you must write the div

emaster function). When called, your function will return the first argument divided by the second argument. Make sure your function includes a decision statement so that it can't divide by 0--if the caller attempts to divide by 0 the function should return a value of -1.0.
Computers and Technology
1 answer:
Firlakuza [10]3 years ago
6 0

Answer:

Following is the C program to divide two numbers:

#include<stdio.h>

double divemaster (double first, double second)

{

//Check if second argument is zero or not

if(second!=0)

    return first/second;

else

 return -1.0;

}

int main()

{

printf("%f\n", divemaster(100,20));

printf("%f\n", divemaster(100,0));

}

Output:

5.000000

-1.000000

Explanation:

In the above program, a function divemaster is declared which divedes the first argument with second and return the result.

Within the body of divemaster function if else block is used to verify that the  second argument is not zero, and thus there is no chance of divide by zero error.

In main two printf statements are used to call the divemaster function. One to check normal division process and second to check divide by zero condition.  

You might be interested in
How does the number of jobs in internet media compare to the number of jobs in tv broadcasting and print media?
sashaice [31]

The number of jobs in internet media is a lot when compare to the number of jobs in tv broadcasting and print media as people can now work remotely from home.

<h3>What is the role of media in entertainment?</h3>

The function of mass media in entertainment is mostly to get the people inform and also entertained.

Note that The number of jobs in internet media is increasing daily as people are creating a lot of content when compare to the number of jobs in tv broadcasting and print media as people can now work remotely from home.

Learn more about internet media from

brainly.com/question/13467876

#SPJ1

5 0
2 years ago
Who wants to join my Among us?<br><br><br>Code: EDQKNF <br><br><br>&lt;3333​
Varvara68 [4.7K]

Answer:

nah

Explanation:

is a lame game for lil kids

5 0
3 years ago
Read 2 more answers
Demand is created through meeting customer buying criteria, credit terms, awareness (promotion) and accessibility (distribution)
tankabanditka [31]

Answer:

Bell

Explanation:

In the given case the product that has the highest Dec. Cust. Survey score will be treated as most competitive at the end of last year. Based on the information provided in the "Top Products in Thrift Segment" table, we can conclude that Bell has highest score for Dec. Cust. Survey score which stands at 31.

Please see attachment for the product list we referenced to as non was given.

7 0
3 years ago
Create a file account.cpp containing a Bank Account Class.
Daniel [21]

Answer:

#include <iostream>

using namespace std;

class BankAccount {

  string name = name;

  double balance = balance;

  BankAccount( string name, double balance ) {

    string name = name;

    double balance = balance;

     return 0;

  }

  string getName( ){

     return name;

  }

  double getbalance( ) {

     return balance;

  void setName( string username){

     name = username;

  }

  void setbalance( double newBalance){

     balance = newBalance;

  }

int main( ) {

  BankAccount user1(John, 0.0);

  BankAccount user2(Jane, 0.0);

  user1.setbalance( 2300.00)

  user2.setbalance( 4300.00)

  cout << user1.getname() << user1.getbalance();

  cout << user1.getname() << user1.getbalance();

}

Explanation:

The C source code above using a class to create a data structure of a bank account user name and balance. The attribute name and balance are private to the class and can be retrieved and modified through the get and set methods.

3 0
3 years ago
You have a notebook computer and wish to connect to an IEEE 802.11n wireless network. The computer does not have a built-in wire
Ira Lisetskai [31]

Answer:

The wireless adapter to use is the Wireless USB 2.0 Extender

Explanation:

The Wireless USB 2.0 Extender is a USB component that enables a computer to connect to and communicate with other computers on a network, or even to connect to the internet.

It uses an IEEE 802.11g radio platform and communicates within a radio frequency range of 2.4GHz.

Therefore, in cases where a notebook computer does not have a built-in wireless LAN card or PC card interface, you can use the Wireless USB 2.0 Extender as the best solution to that problem.

3 0
3 years ago
Other questions:
  • A block style business letter is:
    5·1 answer
  • Which of the following menu commands would you select to make a copy of an open file and rename it?
    15·1 answer
  • Which is a good plan for backing up data?
    6·1 answer
  • A queueing system has four crews with three members each. The number of "servers" is:
    5·2 answers
  • Question 5 (1 point)
    5·1 answer
  • How can netiquette help you communicate when texting or instant messaging?
    6·1 answer
  • Which custom configuration is most likely to include a raid array?
    14·1 answer
  • What does digital mean, in the term of computer science.
    11·1 answer
  • In paragraph form, explain and describe at least three common situations in which you would yield the right-of-way.
    5·1 answer
  • Wyatt has a database to keep track of his enormous collection of videos. How can Wyatt find the details for the game Lost on Mar
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!