answer.
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
kvasek [131]
2 years ago
15

Write a statement that assigns finalResult with the sum of num1 and num2, divided by 3. Ex: If num1 is 4 and num2 is 5, finalRes

ult is 3.
Computers and Technology
1 answer:
olganol [36]2 years ago
6 0

Answer:

Written using Python 3:

<em>num1 = int(input("Enter first value: ")) </em>

<em>num2 = int(input("Enter second value: ")) </em>

<em> </em>

<em>finalResult =(num1+num2) / 3 </em>

<em>print("Answer is: ", finalResult)</em>

<em />

INPUT:

Enter first value: 4

Enter second value: 5

OUTPUT:

Answer is: 3

Explanation:

First step is to declare the variables:

  • num1 and num2

Second is to ask for an input:

  • input("Enter first value: ")

Then we need to convert them into integers by encapsulating the line above inside int(). This is a requirement before you can do any mathematical operations with the given values.

  • num1 = int(input("Enter first value: "))

Next is to calculate:

  • <em>finalResult </em><em>=(num1+num2) / 3 </em>
  • Here we first add the values of num1 and num2, <em>then </em>divide the sum by 3.

And to test if the output is correct, let us print it:

  • <em>print("Answer is: "</em><em>,</em><em> </em><em>finalResult</em><em>)</em>
  • print() - when used for strings/texts, use quotation marks like: "text here"
  • but when used to print variables and numbers (integers, floats, etc), there is no need to enclose them with quotation marks.
  • to concatenate string and an integer (in this case the variable finalResult), simply add a comma right after the string.

<em />

You might be interested in
In the middle of the iteration, how should a team handle requirement changes from the customer? (1 correct answer)
Rina8888 [55]

The answer is 1 because it is

5 0
2 years ago
Read 2 more answers
// This pseudocode is intended to display // employee net pay values. All employees have a standard // $45 deduction from their
Vikki [24]

Answer:

C++ code is given below

Explanation:

#include<iostream>

#include <cstring>

using namespace std;

int housekeeping(string EOFNAME);

int mainLoop(string name,string EOFNAME);

int finish();

void main()

{

  string name;

  string EOFNAME = "ZZZZ";

  cout << "enter the name" << endl;

  cin >> name;

  if (name != EOFNAME)

  {

      housekeeping(EOFNAME);

  }

  if (name != EOFNAME)

  {

      mainLoop(name , EOFNAME);

  }

  if (name != EOFNAME)

  {

      finish();

  }

  system("pause");

}

int housekeeping(string EOFNAME)

{  

  cout << "enter first name " << EOFNAME << " to quit " << endl;

  return 0;

}

int mainLoop(string name, string EOFNAME)

{  

  int hours;

  int rate,gross;

  int DEDUCTION = 45;

  int net;

  cout << "enter hours worked for " << name << endl;

  cin >> hours;

  cout << "enter hourly rate for " << name << endl;

  cin >> rate;

  gross = hours*rate;

  net = gross - DEDUCTION;

  if (net > 0)

  {

      cout << "net pay for " << name << " is " << net << endl;

  }

  else

  {

      cout << "dedections not covered.net is 0.";

  }

  cout << "enter next name or " << EOFNAME << " to quit" << endl;

  cin >> name;

  return 0;

}

int finish()

{

  cout << "end of job"<<endl;

  return 0;

}

3 0
2 years ago
2.32 LAB: Musical note frequencies On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency o
Maurinko [17]

Answer:

#include<iostream>

#include<iomanip>

#include<cmath>

using namespace std;

int main()

{

float f0;

cout<<"Initial Frequency: ";

cin>>f0;

for(int n = 1; n<=5;n++)

{

 cout<<f0<<setprecision(2);

 f0 = f0 * pow(2.0,1.0/12);

 cout<<" ";

}

 

return 0;

}

Explanation:

The programming language is not stated; However, one can easily deduce that the program is to be written using C++

The following libraries enable the program to make use of some built in functions

<em>#include<iostream> </em>

<em>#include<iomanip> </em>

<em>#include<cmath> </em>

using namespace std;

int main()

{

This line declares the initial frequency as float

float f0;

This line prompts user for input

cout<<"Initial Frequency: ";

This line gets user input

cin>>f0;

The following iteration calculates and prints the frequency for thenexr 4 keys

<em>for(int n = 1; n<=5;n++) </em>

<em> { </em>

<em>  cout<<f0<<setprecision(2); </em>

<em>  f0 = f0 * pow(2.0,1.0/12); </em>

<em>  cout<<" "; </em>

<em> }  </em>

return 0;

}

7 0
2 years ago
The code selection above is taken from the Color Sleuth activity you just completed. This selection would count as an abstractio
Vinvika [58]

Answer:

b

Explanation:

4 0
2 years ago
Select the correct answer.
marta [7]

Answer:

A market development

Explanation:

It can be marketing but marketing is attracting satisfying customers, whereas the marketing development is the growth strategy which first finds out, and then develops a new market segment. Nora conducts the surveys of different age group people, and from various social backgrounds, and finds what is the potential target audience. Hence, she is certainly finding the potential target audience for her company's product. And hence she is doing market development, as she is finding a new market segment, and developing it. And hence market development is the correct option.

7 0
2 years ago
Other questions:
  • A(n) _____ is the highest educational degree available at a community college. master bachelor associate specialist
    13·2 answers
  • Information gets from sensory memory to short-term memory through the process of _________.
    13·1 answer
  • Elias wants to name his data in an excel file. Which step is incorrect?
    13·1 answer
  • You would like to conduct a survey and ask your web page visitors to indicate the computer operating systems that they use. Each
    5·1 answer
  • Templates contain common layout and formatting that can save you time by not having to recreate documents from scratch. True or
    10·1 answer
  • Carl knows that water moves through different kinds of soil at different rates. How easily water moves through a soil is known a
    6·1 answer
  • Which broad area of data mining applications analyzes data, forming rules to distinguish between defined classes?
    13·1 answer
  • #Write a function called is_composite. is_composite should #take as input one integer. It should return True if the #integer is
    11·1 answer
  • 1.1.5 practice: analyzing business culture
    13·1 answer
  • Cardinality ratios often dictate the detailed design of a database. The cardinality ratio depends on the real-world meaning of t
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!