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
luda_lava [24]
3 years ago
15

You have been hired by an educational software company to create a program that automatically calculates the sum of each place-v

alue of two numbers. You can assume that the user of this program will only enter positive whole numbers greater than zero and less than 10,000.

Computers and Technology
1 answer:
Vinvika [58]3 years ago
4 0

Hi, you haven't provided the programing language, therefore, we will use python but you can extend it to any programing language by reading the code and the explanation.

Answer:

n1 = int(input("First numeber: "))

n2 = int(input("Second numeber: "))

for i in range(5):

   r1 = n1%10

   r2 = n2%10

   print(r1+r2)

   n1 = n1//10

   n2 = n2//10

 

Explanation:

  1. First, we ask for the user input n1 and n2
  2. We create a for-loop to calculate the sum of each place-value of two numbers
  3. We obtain the last number in n1 by using the mod operator (%) an the number ten this way we can always take the last value, we make the same for n2
  4. Then we print the result of adding the last two numbers (place value)
  5. Finally, we get rid of the last value and overwrite n1 and n2 to continue with the process

You might be interested in
Can someone please answer these questions! Thank you :)
kolbaska11 [484]
1. Technology is something that makes things easier. 2. Technology help students in someway maybe find information about something the good thing about technology in students is that they can learn more things and the bad thing is that technology can be dangerous for students,
3 0
3 years ago
Which header provides functions that deal with exceptional conditions?
Lyrx [107]

Answer:

<exception> header provides functions for exception handling in c++.

Explanation:

Exceptions gives a way to respond to exceptional conditions (like runtime errors) in codes by transferring the control to other special functions called handlers. Since try,catch and throw can work in the iostream header file.To use more functions like unexpected,current_exception,rethrow_exception we need exception header file.

3 0
4 years ago
Access 1.04 knowing your audience
luda_lava [24]

Answer:

What?

Explanation:

I would like to help, but what is the question

4 0
4 years ago
IN C++ PLEASE!!! Read integers from input and store each integer into a vector until -1 is read. Do not store -1 into the vector
ololo11 [35]
#include
#include
using namespace std;

int main(){

int input[] = {-19, 34, -54, 65, -1};
std::vector voutput:
std::vector vinput (input, input + sizeof(input) / sizeof(int) );

for (std::vector::iterator it = vinput.begin(); it != vinput.end(); ++it)
if(*it > 0) voutput.insert(voutput.begin(), *it);
for(std::vector::iterator it = voutput.begin(); it < voutput.end(); ++it)
std::cout << *it << ‘\n’ ;

return 0;
}
6 0
3 years ago
Write a C++ program to calculate the course score of CSC 126. 1. A student can enter scores of 3 quizzes, 2 exams, and a final e
miss Akunina [59]

Answer:

In C++:

#include <iostream>

using namespace std;

int main(){

   double quiz1, quiz2, quiz3, exam1, exam2, finalexam,quiz;

   cout<<"Quiz 1: "; cin>>quiz1;

   cout<<"Quiz 2: "; cin>>quiz2;

   cout<<"Quiz 3: "; cin>>quiz3;

   cout<<"Exam 1: "; cin>>exam1;

   cout<<"Exam 2: "; cin>>exam2;

   cout<<"Final Exam: "; cin>>finalexam;

   if(quiz1<=quiz2 && quiz1 <= quiz3){        quiz=(quiz2+quiz3)/2;    }

   else if(quiz2<=quiz1 && quiz2 <= quiz3){        quiz=(quiz1+quiz3)/2;    }

   else{         quiz=(quiz1+quiz2)/2;     }

   int weight = 0.20 * quiz + 0.30 * ((exam1 + exam2)/2) + 0.50 * finalexam;

   cout<<"Average Weight: "<<weight<<endl;

   if(weight>=91 && weight<=100){        cout<<"Letter Grade: A";    }

   else if(weight>=81 && weight<=90){        cout<<"Letter Grade: B";    }

   else if(weight>=70 && weight<=80){        cout<<"Letter Grade: C";    }

   else{        cout<<"Letter Grade: F";    }

   return 0;

}

Explanation:

See attachment for complete program where comments were used to explain difficult lines

Download cpp
8 0
3 years ago
Other questions:
  • You are researching RAM for a computer you are building for a friend who will be using the system as a home office server for he
    6·1 answer
  • Write a C++ program that reads students' names followed by their test scores. The program should output each students' name foll
    9·1 answer
  • Which of the following is true regarding packaged software and custom software? Group of answer choices Packaged software are ap
    13·1 answer
  • If nobody buys a ticket to a movie, do they still show it?
    5·1 answer
  • 1. Build and test D-type Flip-Flop using a built-in SR flip-flop.
    12·1 answer
  • Write a program that will input miles traveled and hours spent in travel. The program will determine miles per hour. This calcul
    5·1 answer
  • By default, Outlook displays messages in the Content pane grouped by the
    13·1 answer
  • Six security issues and six descriptions are shown below.
    11·1 answer
  • If you need any answer answered faster check out Wolframalpha.com
    14·2 answers
  • Please please help I don’t understand this please.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!