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
Alex_Xolod [135]
4 years ago
13

Make a program (C++). Sum of a 4 digits number and eliminating last digitsȘ

Computers and Technology
1 answer:
igomit [66]4 years ago
5 0

Answer:

#include <iostream>

#include <string>  

int GetEliminationSum(int number)

{

int sum = 0;

std::string s = std::to_string(number);

while (s.length() > 1)

{

 s = s.substr(1);

 sum += std::stoi(s);  

}

return sum;

}

int main()

{

   std::cout << "Enter your 4-digit number: ";

int number;

std::cin >> number;

std::cout << "The elimination sum is " << GetEliminationSum(number);

}

Explanation:

You might be interested in
Which track-type can be used to control the master output levels of output and bus paths? Hint: When assigned to an active outpu
ss7ja [257]

Answer:

Master Fader

Explanation:

Master Fader is the core of any DL Series framework with a demonstrated, intuitive work process that comes out on top in industrial applications.

With a totally adjustable User Interface that is versatile for clients of any aptitude level, Master Fader is the most versatile control application accessible.

It can be used to control bus path or the levels of master output of the output.

4 0
4 years ago
Visual Basics: 1 ) Write an if/else statement that compares the double variable pH with 7.0 and makes the following assignments
Lemur [1.5K]

Answer:

visual basic: 1)

Module PHmodule

   Sub Main()

       'Creating a variable for each entity

       dim ph as double = 0.0, neutral,base,acid as boolean

       'Writing a line to show user what to do

       console.writeline("Enter the pH :")

       'Taking the value

       ph=console.readline()

       'using if & elseif statement for distingushing the values into correct catagories

       if ph<7.0 then

       neutral=false:base=false:acid=true

       elseif ph>7.0 then  

       neutral=false:base=true:acid=false

       elseif ph=7.0 then

       neutral=true:base=false:acid=false

       end if

       'Printing the result

       console.writeline(" Neutral :" & Neutral)

       console.writeline(" base :" & base)

       console.writeline(" acid :" & acid)

       'command for staying in the command prompt for reading the result

       console.readline()

   End Sub

End Module

visual basic: 2)

Module AGEmodule()

  Sub Main()

       'Creating a variable for each entity

       dim age,minors,adults,seniors as integer = 0

       'Taking age from user

       console.writeline("Enter the age")

       age=console.readline()

       'using if & elseif statement for checking the age differnce

       if age<18 then'

       minors +=1

       else if age>18 and age<64 then

       adults +=1

       else if age>64 then  

       seniors +=1

       end if

       'printing result

       console.writeline("minors="&minors)

       console.writeline("adults="&adults)

       console.writeline("seniors="&seniors)

       'command for reading the result  

       console.readline()

  End Sub

End Module

Explanation:

visual basic 1) it is very simple program which allow us to find if the substance is acidic, basic or neutral. we use sim statement for making a variable as double (gives value in decimal) which allow to take a value from the user through console.readline() command and then by using the if statement we apply the condition if the ph is less then, greator then or equal to 7.0 value. thus the program gives us the answer. console.writeline() command is used to print a command on the screen while console.readline() command let us read the lines until we press enter.

visual basic 2)a program which allow us to count and add number of persons according to their age. we use dim statement for creating the variable as integers in which we take the age from user and then after checking it through if statement we increment according to three categories i.e. minors, adults, seniors. the console.writeline() command allow us to print anything on screen and console.readline() allowus to take value while compiling.

thank you...

6 0
4 years ago
Plz I need the answer!!!:(
dimaraw [331]

Answer:

Procedural, Visual, Logic - Based

Explanation:

7 0
3 years ago
Select the correct answer.
liberstina [14]

Answer:

not online stream i got it wrong

Explanation:

3 0
2 years ago
What kind of company would hire an Information Support and Service employee?
andrew-mc [135]

Answer:

THE GANG IS A GANG AND A GANG IS A GANG

Explanation:

4 0
3 years ago
Other questions:
  • The inflexible, circular platters on ____ disks use magnetic particles to store data, instructions, and information.
    5·1 answer
  • 3. The invention of the transistor was important to the development of computers because it
    5·1 answer
  • The text discusses three different steps when processing input. Which of the following is (are) one of those steps? (Check all t
    8·1 answer
  • FREE POINTS JUST ANSWER MY LATEST TWO QUESTIONS PLEASE
    10·2 answers
  • which of the following is not a windows accessory? a. sticky notes b. windows 8 c. sound recorder or d. paint
    8·2 answers
  • Some have argued that Unix/Linux systems reuse a small number of security features in many contexts across the system, while Win
    12·1 answer
  • Sami is creating a web page for her dog walking business. Which item will set the theme for her page? Background color Heading c
    11·2 answers
  • I have crummy WiFi and a bad pc. If I get a gaming computer, will it improve my FPS or ping?
    14·2 answers
  • Question:
    14·1 answer
  • Hypertext enables you to navigate through pieces of information by clicking the __________, that connect them.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!