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
Leni [432]
4 years ago
6

1) The program reads an integer, that must be changed to read a floating point. 2) You will need to move that number into a floa

ting point register and then that number must be copied into an integer register. 3) You will need to extract the exponent from the integer register and stored in another register. 4) You will need to insert the Implied b
Computers and Technology
1 answer:
DochEvi [55]4 years ago
6 0

Answer:

1. Get the number

2. Declare a variable to store the sum and set it to 0

3. Repeat the next two steps till the number is not 0

4. Get the rightmost digit of the number with help of remainder ‘%’ operator by dividing it with 10 and add it to sum.

5. Divide the number by 10 with help of ‘/’ operator

6. Print or return the sum

# include<iostream>

using namespace std;

/* Function to get sum of digits */

class gfg

{

   public:

   int getSum(float n)

   {

   float sum = 0 ;

   while (n != 0)

   {

    sum = sum + n % 10;

    n = n/10;

   }

return sum;

}

};

//driver code

int main()

{

gfg g;

float n = 687;  

cout<< g.getSum(n);

return 0;

}

Explanation:

You might be interested in
You will include code that will validate all user input. If the user inputs an invalid value, the program will respond with an e
alukav5142 [94]

Answer:

See explanation (Program written in C++)

Explanation:

The question is incomplete as the invalid values were not included in the question.

However, to make the sense of it, I'll answer your question using the following conditions.

1. Invalid values include: Numbers less than 0 (See comments for explanations)

#include <iostream>

using namespace std;

int main() {

//This line declares num (for user input)

int num;

//The following iteration keeps repeating itself until a number greater than 0 is entered using do while loop

do{

//This line prompts user for input

cout<<"Numbers greater than 0: ";

//This line gets input from the user

cin>>num;}

while(num<1);//This condition checks for valid user input

cout<<"You entered: "<<num; //This line prints out the user input

}

2. Invalid values include: Odd Numbers

I'll make use of the above code (in 1)

Start by replacing:

cout<<"Numbers greater than 0: ";

with

cout<<"Even Numbers: "; //This prompts user for even numbers

Replace

while(num<1);

with

while(num%2==1); //This checks if input is odd. If yes, the loop is repeated

3. Invalid values include: Even Numbers

I'll make use of the above code (in 1)

Start by replacing:

cout<<"Numbers greater than 0: ";

with

cout<<"Odd Numbers: "; //This prompts user for Odd numbers

Replace

while(num<1);

with

while(num%2==0); //This checks if input is even. If yes, the loop is repeated

8 0
3 years ago
Describe the steps required for setting the date and time in Windows 7.​
Vinvika [58]

Answer:

Explanation:

   Click the displayed time in the taskbar and then click Change date and time settings.

   Figure : Date and time settings encircled in red

   Date and time settings encircled in red

   Figure : Date and Time window

   Date and Time window

   Click the Date and Time tab.

   Click Change time zone. Make sure the correct time zone is selected. Place a checkmark next to Automatically adjust clock for Daylight Saving Time if it is not already selected, and then click OK.

   Figure : Time Zone Settings

   Time Zone Settings

   Click Change date and time.

   Click the small left and right arrows in the calendar to select a month and year, and then click a day within the month.

   Figure : Date and Time Settings: Date

   Date selection in the Date and Time Settings window

   Change the time by entering the hour, minute, AM or PM, or by clicking the up and down arrow buttons. Click OK when the time matches the current time.

   Figure : Date and Time Settings: Time

   Time setting in the Date and Time Settings window

   The time zone, date, and time have been set.

Synchronizing time with Windows 7 internet time server

Windows can automatically synchronize the date and time with a time server to make sure the time displayed on your computer is accurate. Follow these steps to enable Internet Time:

   note: If your computer is part of a domain, the Internet Time feature is not available. Contact your System Administrator for clock synchronization information.

   Click the displayed time in the taskbar and then click Change date and time settings.

   Figure : Change date and time settings

   Change date and time settings

   Figure : Date and Time window

   Date and Time window

   Click the Internet Time tab, and then click Change settings.

   If you are prompted for an Administrator password or confirmation, type the password or provide confirmation.

   Figure : Internet Time tab

   Internet Time tab

   Make sure that Synchronize with an Internet time server is checked.

   Figure : Internet Time Settings

   Internet Time Settings

   Make sure the computer is connected to the Internet and click the Update Now button.

   The computer connects to an Internet server and updates the time on the computer.

       note: If the computer fails to receive an update from the selected Internet time server, a message opens stating that an error has occurred. Select a different server and try again.

   Click OK.

   Your computer's clock will now regularly syncronize via the Internet.

8 0
3 years ago
Please write me a one-paragraph summary of what you have learned about space technology.
kow [346]

Answer:

Space technology. Space technology is technology developed by space science or the aerospace industry for use in spaceflight, satellites, or space exploration. Space technology includes spacecraft, satellites, space stations, and support infrastructure, equipment, and procedures and space warfare. Launched into orbit in 1990, the Hubble truly is one of the greatest space instruments in the history of humanity. And it has been updated significantly in the twenty-first century. But the truth is, space exploration technology, and other discoveries and technologies that arise because of it, are incredibly influential and beneficial; not only does space research improve the economy by keeping scientists and engineers employed

Explanation:

5 0
3 years ago
3D printers, also known as ________, create three-dimensional shapes by adding very thin layer after layer of material until the
xz_007 [3.2K]

Answer:

Additive Manufacturing

Hope this Helps!

5 0
2 years ago
List 3 items that were on kens resume that should have been excluded
ddd [48]

Making it into a brochure, his favorite movies, and eating with chopsticks.

5 0
4 years ago
Read 2 more answers
Other questions:
  • The equation y=2x+1 represents a function true or false
    11·1 answer
  • If a given router can connect to at most k networks, how many routers, r, are required to connect n networks? write an equation
    7·1 answer
  • Code the function (insertNth list N insValue) which constructs a new list by inserting the specified insValue into the list afte
    6·1 answer
  • How much does 1 American tank cost on gas for a regular mission? Depending on your answer, I will give you the right amount of p
    12·1 answer
  • Ideally an entity identifier is composed of _____ attribute(s).
    11·1 answer
  • At a minimum, your vehicle insurance policy must provide coverage of
    10·1 answer
  • The first synthesizers were small simple machines that were easy to use. a. true b. false
    12·1 answer
  • If I add a # symbol in front of the cells row/column, it will keep the value true.
    8·2 answers
  • Define computer ?what is water pollution?<br><br><br>​
    15·1 answer
  • Define computer architecture?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!