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
oksano4ka [1.4K]
3 years ago
10

.) Write a complete C program in one file which takes a double value from the user, cubes it, and prints the result. Your progra

m must use a function which takes a parameter for the value to be cubed and returns the result by value. The function may not print anything or read anything directly from the user (i.e. no cin/cout in the function). Hint: n cubed is defined as n*n*n. Upload as cubeValue.cpp.
Computers and Technology
1 answer:
Ket [755]3 years ago
8 0

Answer:

Explanation:

#include <iostream>

using namespace std;

double cube(double);

int main()

{

   double ci=0;

   cout << "Enter avalue :";

   cin >> ci;

   cout << "Cube of " << ci << "is =" << cube(ci) << endl;

   return 0;

}

double cube(double i)

{

   return(i*i*i);

}

You might be interested in
Mark for review (Will be highlighted on the review page) 3. Which one of the following word processing features saves you the mo
Maksim231197 [3]
B- find and replace can replace any word in the document with another.

7 0
3 years ago
Write a Python 3 program to read from a .csv file containing rates from power companies. Your program should determine the avera
aliya0001 [1]

Answer:

In python:

file = open("rates.csv", "r")

ratecount = 0

ratesum = 0

mylist = []

rates = file.readlines()

for nums in rates:

     num = nums.rstrip('\n')

     mylist.append(int(num))

     for i in num:

           ratesum= ratesum + int(i)

           ratecount = ratecount + 1

print("Maximum Rate: "+str(max(mylist)))

print("Minimum Rate: "+str(min(mylist)))

print("Average Rate: "+str(ratesum/ratecount))

Explanation:

This opens the csv file

file = open("rates.csv", "r")

This initializes the number of rates in the file

ratecount = 0

This initializes the sum of the rates

ratesum = 0

This initializes an empty list

mylist = []

This reads the rates into lines

rates = file.readlines()

This iterates through the rates (as a string)

for nums in rates:

This removes the newline character \n in the rates

     num = nums.rstrip('\n')

This appends the rates (as an integer) to the empty list

     mylist.append(int(num))

The following counts the rates in the file and also sum them up

<em>      for i in num: </em>

<em>            ratesum= ratesum + int(i) </em>

<em>            ratecount = ratecount + 1 </em>

This prints the maximum of the rates

print("Maximum Rate: "+str(max(mylist)))

This prints the minimum of the rates

print("Minimum Rate: "+str(min(mylist)))

This calculates and prints the average rate

print("Average Rate: "+str(ratesum/ratecount))

6 0
3 years ago
In project management, which step involves the project manager identifying
nasty-shy [4]

Answer: The only help is your lord and savior Jesus Christ Amen YAR

Explanation: The Bible or Church

8 0
2 years ago
Which are methods used to improve reading fluency? Check all that apply. Practicing with a weak reader listening to a fluent rea
valina [46]

Answer:

listening to a fluent reader, developing vocabulary monitoring progress, reading a text once rereading a text

Explanation:

6 0
3 years ago
Read 2 more answers
Which of the following calculates to 19<br>(3*6)+2/2<br>3*(6+2)/2<br>(3*6+2)/2<br>3*(6+2/2)​
Firdavs [7]

Answer: The first one (3*6)+2/2 will equal 19.

Explanation: If you use the order of operation you would do 3*6 first then add that to 2/2. So it would be 18+1=19.

3 0
2 years ago
Other questions:
  • Electronic ledger that tracks mathematical data
    15·1 answer
  • Discussion group may have a___________ who monitors the postings and enforces the sides rules​
    13·1 answer
  • Most presentations use text: A. To maximize area and style. B. At a minimum. C. To draw attention to content. D. Without restrai
    9·2 answers
  • Steps in the systems development life cycle​
    15·2 answers
  • In this scenario, hackers launch cyber-attacks that affect several parts of the nationâs financial infrastructure over the cours
    8·1 answer
  • The current standard for RFID is based off of Group of answer choices MIT standards IEEE standards ISO standards there is no agr
    12·1 answer
  • ___signs tell you what you can or can't do, and what you must do ?
    5·2 answers
  • highlight the possible risks and problems that should be address during the implementation of information system process
    5·1 answer
  • Why is computer called information processing maching???​
    6·2 answers
  • The use of desktop computer equipment and software to create high-quality documents such as newsletters, business cards, letterh
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!