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
Pavlova-9 [17]
3 years ago
11

Given that a function receives three parameters a, b, c, of type double, write some code, to be included as part of the function

, that checks to see if the value of a is 0; if it is, the code prints the message "no solution for a=0" and returns from the function.
Computers and Technology
1 answer:
never [62]3 years ago
3 0

Answer:

Following are the code in the C Programming Language.

if(a==0) //set if conditional statement

{

//print the following message

printf("no solution for a=0");

}

Explanation:

Here, we define a function and pass three double data type variable i.e., "a", "b", "c" and then we write the following code inside the function.

  • Set the if conditional statement and check that condition is the variable "a" is equal to 0.
  • Then print message through the "printf()" which display on the screen if the given condition is true.
You might be interested in
host b is sending an email intented for the user on host a to the mail server what protocol is being used to send the message
KatRina [158]

Answer:

SMTP

Explanation:

This is the SMTP or the Simple Mail Transfer Protocol. It is the push protocol and is used to send the mail message. Whereas POP3 and IMAP are meant for retrieving the message. These are the three main types of protocols associated with mail services. And the correct answer here is certainly the SMTP.

3 0
3 years ago
Given an int as the input, print all the factors of that number, one in each line. For example, if the input is 15 The output wi
trapecia [35]

Answer:

The program to calculate factor can be given as:

Program:

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

int main() //defining main function

{

   int a,i; //defining integer variable

   printf("Enter any number: "); //print message

   scanf("%d",&a); //input value from user end

   for(i=1;i<=a;i++) //loop for calculate factor values

   {

       if(a%i==0) //define condition for factor

       {

           printf("%d\n",i); //print values

       }

   }

   return 0;

}

Output:

Enter any number: 15

1

3

5

15

Explanation:

In the above C language program the header file is include that provide the use of basic function, in the next line the main method is defined, inside this method two integer variable "a and i" is defined in which variable a is used to take value from user end and variable i is used in loop and conditional statement.

  • In the next step, for loop is declare, that start from 1 and end with value of variable a, inside a loop, if block is used that checks (a%i==0), in this if variable i value modeler value equal to 0.  
  • The loop will use the print function that prints variable "i" element in a new line, which is the factor the values.  

4 0
2 years ago
Read 2 more answers
8.11 LAB: Count characters - functions Write a program whose input is a character and a string, and whose output indicates the n
Shkiper50 [21]

Answer:

#include<iostream>

using namespace std;

int CountCharacters(char userChar, const string inputstr){

   int k = 0;

   int iter = 0;

   for (iter = 0; iter < inputstr.size(); iter++){

       if (inputstr[iter] ==  userChar){

           ++k;        }}

   return k;}

int main(){

   string str;

   char userChar[1];

   cout<<"Char: ";    cin>>userChar;

   cin.ignore();

   cout<<"String: ";   getline(cin, str);

   cout<<CountCharacters(userChar[0],str);

   return 0;}

Explanation:

Written in C++:

The function is defined here:

int CountCharacters(char userChar, const string inputstr){

This initializes a count variable k to 0

   int k = 0;

This initializes an iterating variable iter to 0

   int iter = 0;

This iterates through the characters of the string being passed to the function

   for (iter = 0; iter < inputstr.size(); iter++){

This checks for matching characters

       if (inputstr[iter] ==  userChar){

If found,  k is incremented by 1

           ++k;        }}

This returns the total count

   return k;}

The main begins here

int main(){

This declares a string variable

   string str;

This declares a character variable

   char userChar[1];

This gets input for the character variable

   cout<<"Char: ";    cin>>userChar;

This lets the user get another input

   cin.ignore();

This gets input for the string variable

   cout<<"String: ";   getline(cin, str);

This calls the function and return the count of character in the string

   cout<<CountCharacters(userChar[0],str);

6 0
2 years ago
Histogram 9AMAA 12/01/2021.
pshichka [43]
??????? I don’t get this
5 0
2 years ago
A variable like userNum can store a value like an integer. Extend the given program to print userNum values as indicated.(1) Out
dimulka [17.4K]

Answer:

The program in Java is as follows:

import java.util.*;

public class Main{

public static void main(String[] args) {

 int userNum;

 Scanner input = new Scanner(System.in);

 System.out.print("Enter integer: ");

 userNum = input.nextInt();

 System.out.println("You entered "+userNum);

 System.out.println(userNum+" squared is "+(userNum*userNum));

 System.out.println(userNum+" cubed is "+(userNum*userNum*userNum));

 int userNum2;

 System.out.print("Enter another integer: ");

 userNum2 = input.nextInt();

 int sum= userNum + userNum2; int product = userNum2 * userNum;

 System.out.println(userNum+" + "+userNum2+" = "+sum);

 System.out.println(userNum+" * "+userNum2+" = "+product); } }

Explanation:

This declares userNum

 int userNum;

 Scanner input = new Scanner(System.in);

This prompts the user for input

 System.out.print("Enter integer: ");

This gets user input from the user

 userNum = input.nextInt();

Number (1) is implemented here

 System.out.println("You entered "+userNum);

Number (2) is implemented here

 System.out.println(userNum+" squared is "+(userNum*userNum));

 System.out.println(userNum+" cubed is "+(userNum*userNum*userNum));

This declares another variable userNum2

 int userNum2;

This prompts the user for another input

 System.out.print("Enter another integer: ");

This gets user input from the user

 userNum2 = input.nextInt();

This calculates the sum and the product

 int sum= userNum + userNum2; int product = userNum2 * userNum;

Number (3) is implemented here

 System.out.println(userNum+" + "+userNum2+" = "+sum);

 System.out.println(userNum+" * "+userNum2+" = "+product);

8 0
2 years ago
Other questions:
  • When desktop publishing software can interact with another software program, the two are said to
    6·1 answer
  • A powerpoint ________ is a set of unified design elements.
    5·1 answer
  • During an interview, your non-verbal communication (body language, gestures, tone of voice, speed of talking,
    6·1 answer
  • 3. Which of the following statements is true of a time management plan? 35 POINTS
    9·2 answers
  • Objects falling through air experience a type of friction called.. A.terminal velocity B.air resistance C.rolling friction
    8·1 answer
  • When RadioButton objects are contained in a group box, the user can select only one of the radio buttons on the panel.
    12·1 answer
  • What term refers to the text label that describes each data series?
    9·1 answer
  • Placeholders can hold text but not graphics such as photos or charts. True or false?
    7·1 answer
  • Which sentence is an example of an I-statement?
    6·1 answer
  • A wireless ________ extender is a network device that enhances transmission of your wireless signal.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!