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
Rama09 [41]
3 years ago
11

Write a statement that computes the square root of a variable called discriminant

Computers and Technology
1 answer:
marysya [2.9K]3 years ago
4 0

Answer:

// here is statement in C++ to compute square root of a variable.

double result=sqrt(discriminant);

Explanation:

Sqrt() method will compute the square root of a variable in C++.Read a value of discriminant and find the square root of it and assign it to variable "result".

Implementation in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

  // variables

  double discriminant;

  // ask to enter discriminant

  cout<<"Enter the discriminant:";

  // read discriminant

  cin>>discriminant;

  double result=sqrt(discriminant);

  cout<<"Square root of discriminant is:"<<result<<endl;

  return 0;

}

Output:

Enter the discriminant:50                                                                                                  

Square root of discriminant is:7.07107

You might be interested in
The most basic software required for an online course where writing is involved is:
Andrej [43]
The annswer is word processing.
7 0
3 years ago
Why OSI is called open system?
MAXImum [283]

Answer: OSI system is called Open System Interconnection because It provides the collection of protocols for the connection of different system to connect with  any dependence on any other system or network.

Explanation: Open system interconnection establishes a connection between the different system for the communication purpose using several protocols and software standards .It has no dependency or any network or other system to do the functioning and works using the seven layers of the OSI architecture.Thus, that is why OSI system known as open system.

7 0
3 years ago
For this step, submit your work in the programming environment by
Tems11 [23]

Answer:

is there some oppsense you can choose from

7 0
3 years ago
A program is considered portable if it . . . can be rewritten in a different programming language without losing its meaning. ca
Semenov [28]

Answer:

Can be executed on multiple platforms.

Explanation:

A program is portable if it is not platform dependent. In other words, if the program is not tightly coupled to a particular platform, then it is said to be portable. Portable programs can run on multiple platforms without having to do much work. By platform, we essentially mean the operating system and hardware configuration of the machine's CPU.

Examples of portable programs are those written in;

i. Java

ii. C++

iii. C

8 0
3 years ago
Banking Account
satela [25.4K]

Answer:

Here is the Python script solution.

Explanation:

#!/usr/bin/python

"""Types of bank accounts"""

# Assignment:

# Bank Account Manager - Create a class called Account which will be an abstract

# class for three other classes called CheckingAccount, SavingsAccount and

# BusinessAccount. Manage credits and debits from these accounts through an ATM

# style program.

from __future__ import print_function

def pct_to_dec(num):

"""Returns decimal version of percent"""

dec = float(num) / 100

return dec

class Account(object):

"""Creates an Account"""

def __init__(self, balance, int_rate, act_type, min_balance, **kwargs):

self.balance = balance

self.int_rate = int_rate

self.act_type = act_type

self.min_balance = min_balance

super(Account, self).__init__(**kwargs)

def __str__(self):

"""Returns formatted account type and balance"""

# Charge $25 fee if balance drops below minimum

if self.balance < self.min_balance:

self.balance -= 25

# Add interest

self.balance += round(self.balance * pct_to_dec(self.int_rate), 2)

return '{0}: ${1}'.format(self.act_type, self.balance)

class CheckingAccount(Account):

"""Creates a CheckingAccount Account"""

def __init__(self, **kwargs):

super(CheckingAccount, self).__init__(**kwargs)

class SavingsAccount(Account):

"""Creates a SavingsAccount Account"""

def __init__(self, **kwargs):

super(SavingsAccount, self).__init__(**kwargs)

class BusinessAccount(Account):

"""Creates a BusinessAccount Account"""

def __init__(self, **kwargs):

super(BusinessAccount, self).__init__(**kwargs)

# pylint: disable=C0103

ca1 = CheckingAccount(balance=500, int_rate=0.25, act_type='Checking Account',

min_balance=0)

sa1 = SavingsAccount(balance=50, int_rate=0.50, act_type='Savings Account',

min_balance=0)

ba1 = BusinessAccount(balance=4000, int_rate=0.75, act_type='Business Account',

min_balance=5000)

# Month #1 statement, initial deposits plus interest

print(ca1)

print(sa1)

print(ba1)

print('-------------')

# Month #2 statement plus interest

# Make deposit into checking

setattr(ca1, 'balance', (ca1.balance + 1000))

# Withdraw from checking

setattr(ca1, 'balance', (ca1.balance - 500))

# Make a deposit into savings

setattr(sa1, 'balance', (sa1.balance + 100))

print(ca1)

print(sa1)

print(ba1)

print('-------------')

# Month #3 statement plus interest

# Make deposit into checking

setattr(ca1, 'balance', (ca1.balance + 2500))

# Withdraw from checking

setattr(ca1, 'balance', (ca1.balance - 700))

# Make a deposit into savings

setattr(sa1, 'balance', (sa1.balance + 100))

# Make a deposit into business

setattr(ba1, 'balance', (ba1.balance + 1000))

print(ca1)

print(sa1)

print(ba1)

4 0
4 years ago
Other questions:
  • WILL DO A BRIANLY! Use an algorithm to help the Python Turtle get to the finish line in 10 steps by using only the 3 commands be
    12·1 answer
  • Fact Pattern: A sales transaction record designed to contain the information presented below. Column Information 1-10 Customer a
    13·1 answer
  • Front and rear camber and toe settings are being adjusted during a four-wheel alignment. The correct order for performing these
    13·1 answer
  • ________ allows the computer to get its configuration information from the network instead of the network administrator providin
    5·1 answer
  • Make me die from laughter i will give brainlyest for the best joke
    11·1 answer
  • Computers help eliminate that repetitive of manual task. How can this benefit you in in your overall career
    7·2 answers
  • Please tell fast plzzzzzzzz​
    11·2 answers
  • For enterprise servers, or servers accessed around the clock, SATA disks are preferred over SAS disks. True or False
    12·1 answer
  • Who is willam afton from five nights at freddy
    13·2 answers
  • The federal communications commission oversees the programming of which entities?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!