The code snippet below checks whether a given number is a prime number. What will be the result of executing it? public static void main(String[] args) { int j = 2; int result = 0; int number = 0; Scanner reader = new Scanner(System.in); System.out.println("Please enter a number: "); number = reader.nextInt(); while (j <= number / 2) { if (number % j == 0) { result = 1; } j++; } if (result == 1) { System.out.println("Number: " + number + " is Not Prime."); } else { System.out.println("Number: " + number + " is Prime. "); }.A) The code snippet will not compile.
B) The code snippet will display the desired result.
C) The code snippet will display an incorrect result.
D) The code snippet will loop forever.

Answers

Answer 1

Answer:

B) The code snippet will display the desired result.

Explanation:

The code Snippet will give the expected result.

Prime numbers are numbers that are have only two divisors... That is 1 and itself

The while block:    

   while (j <= number / 2) {

           if (number % j == 0) {

               result = 1;

           }

           j++;

       }

ensures that whenever there is a remainder of dividing the variable number by j, then it is not a prime number, since prime numbers are only divisible by 1 and themselves. The result =1 is then tested in an if statement to give the expected output

Answer 2

Final answer:

The code snippet correctly determines if a number is prime and will display the desired result; however, the efficiency could be improved by checking divisors only up to the square root of the number.

Explanation:

The code snippet provided checks whether a given number is prime. The result of executing this code snippet will be B) the code snippet will display the desired result. When the user enters a number, the program will divide that number by all integers from 2 up to the number divided by 2.

If any of these divisions result in a remainder of 0, the result variable is set to 1, indicating that the number is not prime. If none of the divisions have a remainder of 0, the result variable remains at 0, meaning the number is prime.

The only issue with this code is that it will continue checking until number/2 even though we could optimise it by only checking up to the square root of the number (number¹/²). However, this does not affect the accuracy for determining if a number is prime within the range checked.


Related Questions

Write a statement that declares a PrintWriter reference variable named output and initializes it to a reference to a newly created PrintWriter object associated with a file named "output.txt".

Answers

Answer:

PrintWriter variable = new PrintWriter("output.txt");

Explanation:

There are two ways of declaring a reference variable in programming.

One way is

Reference Variable-name = new Reference ("some texts here");

While the other is

Reference Variable-name;

Variable-name = new Reference ("some texts here");

Both ways are valid ways of reference variable declaration.

In the question above, the reference is PrintWriter, it points to output.txt and the question says "write a single statement";

Hence, we make use of

PrintWriter variable = new PrintWriter("output.txt");

A reference variable is declared to be of a specific type and that type can never be changed.

You upgrade your network to 1000 Mbps from 100 Mbps. You install a new 1000-Mbps network adapter into your Windows system. You check the device manager and see no errors or warning. You configure the TCP/IP settings to be as they were for the previous network adapter. Upon restarting the computer, you cannot access the network. You ping your IP address locally and receive the error message, "Request timed out." You then ping 127.0.0.1 and receive the same error message. What do you do?

Answers

Answer:

Replace the NIC

Explanation:

A node needs a network connectivity to perform and function well as part of a cluster. If a single network interface is available, the breakdown of the other network interfaces will not cause service interruption but will most likely cause service degradation.

Simple ways to know if you need to change your NIC is to go Click Start and the you right-click on Computer, then you toggle over and click Properties, it will bring a window box and From there, click Device manager. Screen the window to where it says "Network adapters". If there's a question mark or an exclamation there, then you have an ethernet problem that needs troubleshooting; if not then you're OK.

You are tasked with accumulating survey data on a web page and are responsible for it being free from dirty data once you close the survey and get the data to the researching team. Which is the best way to handle the possibility of dirty data?

Answers

Answer:

Build a website that validates data as the survey participant takes the survey.

Explanation:

Whenever a user is charged towards gathering survey information on such a webpage and seems to be liable for freeing this against bad data when the survey is closed as well as the data will be sent to the testing group.

Creating a platform that validates information is just the easiest approach to tackle the risk of bad results as when the research user completes the test.

What is the name of the virus that appears to be a legitimate program but when opened

Answers

Answer: trojan horse virus

Explanation:A trojan horse is a non-replicating program that looks legitimate, but it is actually used to perform malicious and illicit activities when launched. Attackers use trojan horses to steal a user's

personal information like password information, or they may simply use it to destroy programs or data on the hard disk.

___________provides vital protection and maintenance services for system hardware and software, including enterprise computing systems, networks, transaction processing systems, and corporate IT infrastructure.a. User support
b. Database administration
c. Systems support and security
d. Network administration

Answers

Answer:

C) System support and security.

Explanation:

The aspect of systems support and security in ICT has to do with troubleshooting, fixing and installation of computer system software and hardware of many different types.

It also involves the monitoring and implementation of security measures to protect networks, systems and information.

Also, innovation of security architectural designs and identification and resolution of the causes of security threats and application of effective secured enhancements.

It also has to do with the testing of security softwares for possible breaches and fixing them if found.

System support specialists and security engineers work in these fields and are responsible for these roles. They may work independently or sometimes in groups, brainstorming and contributing creative ideas for their companies.

The next generation of 3-D video will be based on _____ technology, where a viewer will be able to get different views of the scene by moving her head or walking around the display. This will involve dynamic depth cues that result from the viewer’s own motion, not just from the motion of objects in the scene.

Answers

Answer:

Virtual Reality Technology

Explanation:

Virtual reality is a simulation based computer technology which imitates the real world and provides real life like experience. One of the key  applications of virtual reality is 3D video games where users use VR headsets and get immersed into the world of simulated reality. VR technology also incorporates sensory inputs from the user, their physical movement gets translated in real time and they can move around and interact with various features. They can also sense dynamic depth which provides a real world experience.

The computer program that Josh is working on presents him with a sentence in which a word has been underlined. Josh has to indicate the part of speech represented by the underlined word. After receiving feedback about the correctness of his response, Josh is given another sentence with an underlined word. This description best illustrates what type of computer-based instruction (CBI) program?

Answers

Answer:

Drill and practice.

Explanation:

That system program for which Josh works provides himself with such a sentence stressing a phrase. He must signify that portion of speech described by that of the term that has been emphasized.  

He being provided a further statement with such an underlined term while getting suggestions regarding the current consistency for his answer This definition is the best demonstration of CBI system Drill and practice.

A website that sells high-end ties notices that its ads are showing up for searches that include "cheap". Because its ties are expensive, it does not want its ads to show up for searchers using the word "cheap". What should this advertiser do?

Answers

Answer: Add "cheap" to the negative keyword list.

Explanation: Pretty self explanatory, by adding a negative keyword It should not use that word if searched to find people to advertise to.

The analysts at Techno Info Systems are considering the four-model approach to system development for a new client. If they make use of the four-model approach, which of the following is a likely outcome?
A. It will not be possible to get ac clear picture of the current system functions before modifications are made.
B. Time taken to develop the model increases.
C. The requirements of a new information system will always be different from the current information system.
D. Costs need to develop a logical and physical model of the current system will be less.

Answers

Answer:

B

Explanation:

...if they make use of the four-model approach, the time taken to develop the model would increase.

Cheers

You place a new disc in an optical drive, and then double-click the drive in the operating system's file browser interface. An error message appears stating that the drive is not accessible. What should you do

Answers

Answer:

Wait. Then you try it again

Explanation:

You wait and try again later and if this still persists, you may have to check the optical drive from the drive manager peradventure there is an issue there probably a software issue, also you may have to clean the optical drive using the cleaner disc, likewise you may need to test an old disc on the optical drive to be sure the fault is not from the disc you inserted.

You have a server with Windows Server 2012 R2 installed on Disk 0, a basic disk. You use the server to store users' documents. You have two more disks that you can install in the server. What should you do if you want to provide fault tolerance for users' documents

Answers

Answer:

Create a RAID 1 volume from Disk 1 and Disk 2.

Explanation:

To provide fault tolerance for users' documents we should create a RAID 1 volume from Disk 1 and Disk 2.

You need to connect a workstation to a switch using a regular port on the switch (not an uplink port). The switch does not support auto- MDI. Which type of cable should you use.

Answers

Answer:

The correct answer to the following question will be "Straight-through ".

Explanation:

It's a kind of twisted-pair wire used for interact a device to a networking center like a modem  or router in LAN.

By linking two separate kinds of connected devices, use this cable.This connection is often applied to this as a repaired cable, too.

So, it's the right answer.

After class, Anita and Bev make plans to study for their psychology exam together but cannot decide on a time or location. In addition, Anita realizes that she left her phone in her apartment. Anita and Bev change their mind and agree that it is easiest simply to meet at Bev's dorm. Bev gives Anita her room number and passcode. Anita likely will be able to retain this information in short-term memory, without additional processing, for:_________.a. a second or lessb. 30 seconds or lessc. about two minutesd. a maximum of five minutes

Answers

Answer:

Option B; 30 SECONDS OR LESS.

Explanation:

Short-term memory, also known as primary or active memory, is the information we are currently aware of or thinking about.

When short-term memories are not rehearsed or actively maintained, they last mere seconds.

Most of the information kept in short-term memory will be stored for less than 30 seconds (approximately 20 to 30 seconds), but it can be just seconds if rehearsal or active maintenance of the information is not done.

Therefore, Anita likely will be able to retain the information in short-term memory, without additional processing, for 30 SECONDS OR LESS.

Use of the Internet for recruiting is: a. popular with job seekers, but not recruiters. b. the most commonly used search tactic by job seekers and recruiters. c. cheaper and easier, but less effective than other methods. d. popular with recruiters, but not job seekers.

Answers

Answer:

the most commonly used search tactic by job seekers and recruiters.

Explanation:

Internet is used in various ways and both job seekers and recruiters can take advantage of this to look for jobs and hire respectively.  Most business use this platform to help open doors to very many candidates. Almost everything nowadays in most situations is conducted online, from posting job ads, to emailing successful candidates to setting up interviews through video calls. Posting a job ad online widens the radius for interested candidates and most businesses are not constrained while trying to look for the perfect applicant. In America alone, almost 80% of Americans take leverage of the online resources to look for open job positions.

Of the measures of feasibility in the accompanying figure, ____ considers points such as "Does the proposed platform have sufficient capacity for future needs?" and "Will the hardware and software environment be reliable?"
a. schedule feasibility
b. technical feasibility
c. economic feasibility
d. operational feasibility

Answers

Answer:b. technical feasibility

Explanation: Technical feasibility is an important tool for both troubleshooting and maintenance,it is the process through which an expert evaluates a process or a product in order to determine what can either be achieved or to the extent to which a certain action will lead to a tangible result.

Technical Feasibility is one of the most important factor when making decisions on the use of materials or equipments in a particular environment or condition.

When sending the right email, there are three key things you’ll need to understand: why you are sending that email, your goal, and the value you’re delivering to the person on the other end of the send. This gives you the foundation to __________.

Answers

Answer:

Explanation:

the required expectations with the receiver by setting an

appropriate and contextual goal and then aligning it with information that will

provide the most value

You are flying on an ifr flight plan at 5500 feet with a vfr on top clearance when you encounter icing. you know there is clear air above and you request 9500 feet from atc they deny the request. A. Yes, you are still IFR with a VFR-on-top clearance.
B. No, you are now VFR.
C. No, your VFR-on-top clearance has been canceled.

Answers

Answer:

A. Yes, you are still IFR with VFR-on-top clearance

Explanation:

Instrument Flight Rules (IFR) and Visual Flight Rules (VFR) are regulations controlling the operations of civil aviation. Pilots use these terms as well to describe their flight plan.

When your request is rejected to fly 9500 feet from atc, your VFR-on-top clearance is still active and you are still IFR.

Suppose the beta of Microsoft is 1.13, the risk-free rate is 3 percent, and the market risk premium is 8 percent. Calculate the expected return for Microsoft.

Answers

Answer:

8.65%

Explanation:

Rj = Rf + risk premium.

Rj = Rf + β[E(RM − Rf)].

= 3 + 1.13 (8 - 3)

= 3 + 1.13 x 5

= 3 + 5.65

= 8.65 percent

This relationship between risk and expected return is called the security market line.

The expected return for Microsoft, using CAPM and the given risk-free rate, beta, and market risk premium, is 12.04 percent.

To calculate the expected return for Microsoft, given that the beta of Microsoft is 1.13, the risk-free rate is 3 percent, and the market risk premium is 8 percent, we can use the Capital Asset Pricing Model (CAPM). The CAPM formula is:

Expected Return = Risk-Free Rate + (Beta Times Market Risk Premium)

Plugging in the given values:

Expected Return = 3% + (1.13 Times 8%)

Expected Return = 3% + 9.04%

Expected Return = 12.04%%

Therefore, the expected return for Microsoft is 12.04% percent.

Nielsen purchases scanner data from retail transactions to track the sales of consumer packaged goods, gathered at the point of sale in retail stores of all types and sizes. Scanner data is an example of:

Answers

Answer: syndicated external data.

Explanation: This brings us to the definition of syndicated data :-

Syndicated data refers to general market data that is not specific to any particular client, rather a compilation of retailer and product data, syndicated data is generally collected by market research firms and then bought by businesses who have developed interest in the market.

Microsoft ____________________ is a complex, full-featured firewall that includes stateful packet filtering as well as proxy services, NAT, and intrusion detection.

Answers

Answer:

Internet Security & Acceleration Server (ISA)

Explanation:

Fill in the blanks

Microsoft Internet Security & Acceleration Server (ISA) is a complex, full-featured firewall that includes stateful packet filtering as well as proxy services, NAT, and intrusion detection.

Windows 10 features a storage solution called Storage Spaces. What is the name of the Storage Spaces feature that allows allocating space for redundant information using options that include two-way mirroring, three-way mirroring, and parity

Answers

Answer:

Data resiliency.

Explanation:

Spaces for storage may involve resilience to the information. Selecting a resiliency solution implies whether they assign capacity towards redundant details. The information resiliency choice regarding storage facilities.

Two-way mirror needs two capacity units or more. The information is engraved on both computers. Two-way mirror enables twice the volume of storage assigned to that of the storage capacity as such system capacity. This choice will prevent you against loss of a specific storage unit.

An optimal solution to a linear programming problem MUST lie A. somewere on the line between two corner points. B. somewhere outside of the feasible region. C. somewhere in the interior of the feasible region. D. at the intersection of at least two constraints.

Answers

Answer:

D. at the intersection of at least two constraints.

Explanation:

Linear programming is an optimization technique which is fine for the purpose of getting the best solution such as maximizing profit or certain o 4th era quantities. It is fine by modelling real life problems into mathematical models that have linear relationships or constraints such as in the form of objective functions. In linear programming, an objective function defines the formula for quantity optimization and the goal from this is to determine variable values that maximize or minimize the objective function depending on the problem robbery solved.

What does it mean for a wireless network to be operating in "infrastructure mode"? If the network is not in infrastructure mode, what mode of operation is it in, and what is the difference between that mode of operation and infrastructure mode?

Answers

Answer and Explanation:

Within the following operating mode, most of the wireless controller remains linked through the main point (access point) for that broader server. The server runs within ad-hoc modes when this does not run under the following mode. Wireless servers wouldn't have the connectivity to interact within ad-hoc mode.

So, the following statement is correct according to the given scenario of the following mode.

Samantha was hired to perform an internal security test of company XYZ. She quickly found that all networks are making use of switches instead of traditional hubs. This greatly limit her ability to perform network sniffing for information gathering. Which of the following techniques could she use use to gather information from the switched network or to disable some of the traffic isolation feature of the swtich?a. sniff in promiscuous mode b. ethernet zapping c. ARP spoofing d. TCP session hijacking

Answers

Answer:sws

Explanation:swwswswsswswsw

A stack is initially empty, then the following commands are performed: push 5, push 7, pop, push 10, push 5, pop, which of the following is the correct stack after those commands (assume the top of the stack is on the left)? A. 5, 10, 7, 5.
B. 5, 10.
C. 7, 5.
D. 10, 5.

Answers

Answer:

d

Explanation:

You work as the IT administrator for a small corporate network. One of the company employees needs to add an additional PCI card to the motherboard. When you open the computer, you see that the card purchased will not fit due to the card's height.

Answers

Final answer:

The question involves a compatibility issue with a PCI card's installation in a small corporate network's computer system. It requires an understanding of the technical specifications and form factors of both the motherboard and the PCI card to resolve the problem.

Explanation:

The subject of the question pertains to installing additional hardware in a computer, specifically within the context of Computers and Technology. The scenario at hand deals with a physical compatibility issue between a PCI card and the available space on the motherboard concerning the card's height. It is important to recognize that there are different sizes of PCI cards, including standard and low-profile cards, and they must match the specifications of the available slots to ensure a proper fit. This might require purchasing a different type of PCI card or utilizing a different slot that accommodates the card's dimensions.

Your networking card is crucial for connecting your system to a network but encountering a compatibility issue requires quick problem-solving to maintain productivity in a corporate environment. The key to resolving this issue lies in understanding the technical specifications of the motherboard and the PCI card, and then taking appropriate action either by exchanging the card for one with the correct form factor or modifying the arrangements inside the case if possible and if not against company policy.

Assuming that a user enters 5 as the age, what is the output of the following code snippet? int age = 0; Scanner in = new Scanner(System.in); System.out.print("Please enter your age: "); age = in.nextInt(); if (age < 10) { System.out.println("Kid"); } if (age < 30) { System.out.print("Young"); } if (age < 70) { System.out.print("Aged"); } if (age < 100) { System.out.print("Old"); }

Answers

Kid
YoungAgedOld

It will print out this way because the code uses if statements, rather than else if statements. As written, every single if statement will be triggered because each expression will evaluate to true. If there were else statements involved, then only the first one that is triggered will print out, and the rest will be ignored.

The reason for the weird formatting/spacing is because only the first print statement is println which adds a new line after printing. The other statements are just print, which does not add a new line or a space.

The analysts at Techno Info Systems are considering the four-model approach to system development for a new client. If they make use of the four-model approach, which of the following is a likely outcome?
A. It will not be possible to get ac clear picture of the current system functions before modifications are made.
B. Time taken to develop the model increases.
C. The requirements of a new information system will always be different from the current information system.
D. Costs need to develop a logical and physical model of the current system will be less.

Answers

Answer:

Option B is correct.

Explanation:

Within Techno Info Systems the user has been analyst contemplating that four-model concept towards computer development for such its new customer. When they adopt that four-model method, thus the result seems to be the time taken to implement the rises in the method.

So, therefore the other options are incorrect according to the following scenario.

Final answer:

Using the four-model approach to system design likely leads to an increase in the time taken to develop the model, as it entails creating complex and detailed models to replace the real system for analysis.

Explanation:

If the analysts at Techno Info Systems employ the four-model approach to system development for a new client, a likely outcome is that time taken to develop the model increases. This approach involves creating different models, each with its purpose and complexity. For instance, understanding ecosystem dynamics necessitates analytical and simulation models that can predict the consequences of changes within an ecosystem. Similarly, a four-model approach in system development requires meticulous detail, and this extensive modeling aims to replace the real system with an easier-to-examine version, ultimately providing more reliable predictions and a detailed design.



However, as the complexity of models increases with the aim of better accuracy and understanding, it also often leads to longer development times. While the models serve to understand the system before making modifications, a more detailed four-model approach means investing more time to build and analyze each model. One must balance the drive for comprehensive understanding against the requirement to deliver results in a timely manner.

A recent antivirus scan on a server detected a Trojan. A technician removed the Trojan, but a security administrator expressed concern that unauthorized personnel might be able to access data on the server. The security administrator decided to check the server further. Of the following choices, what is the administrator MOST likely looking for on this server?
a. Trojan
b. spyware
c. adware
d. ransomware

Answers

Answer:

B. Spyware

Explanation:

Spywares are silent software that steals sensitive information such as internet or company data, and other similar information. They are oftentimes unnoticed and supply stolen data to external users, data centers or advertisement companies.

Sophisticated spyware can go as far as installing software to manipulate your settings or use passwords on your behalf.

Even though the Trojan was detected in our scenario, The Trojan would have created a backdoor to allow spyware in. This spyware will not be easily noticed by the technician or the antivirus, however, it could be more devastating than the Trojan.

That is why the security administration expresses concern over a breach despite the removal of the Trojan.

Which collaboration technology is becoming more and more popular within organizations because it provides a means for forming ad hoc groups, networking and locating potential business allies?

a) Intranet
b) Wikis
c) VoIP
d) Social networking sites
e) Unified communications

Answers

Answer:

d) Social networking sites

Explanation:

-Intranet is a network that is created by an organization to share information, tools and different services inside the company.

-Wikis are websites used to share content and knowledge and different users can modify the information.

-VoIP is a technology that allows you to make calls over the internet.

-Social networking sites are online platforms that allow people to connect with organizations and other people, create communities online and share different types of information.

-Unified communications is a system that has different communication methods through a single application.

According to this, the collaboration technology that is becoming more and more popular within organizations because it provides a means for forming ad hoc groups, networking and locating potential business allies is social networking sites.

Other Questions
will your balance increase on your credit card from month to month if you have a balance, but no new charges?why? A proton (being 1836 times heavier than an electron) gains how much energy when moving through a potential increase of one volt? Find x and y on a 30 60 90 triangle number 9 Most African countries achieved their independence from colonial powers in the 1960s and 1970s. Identify how colonial influence and ideas about sexuality are intertwined in postcolonial Africa? Congress passes legislation that requires all people to have health insurance or pay fines to the government. The president analyzes the legislation and signs it. Several different individuals challenge the law as unconstitutional and the United States Supreme Court agrees to hear the case. After the hearing, the justices declare that the law is constitutional. This is an example of:_________. Companies HD and LD are both profitable, and they have the same total assets (TA), Sales (S), return on assets (ROA), and profit margin (PM). However, Company HD has the higher debt ratio. Which of the following statements is CORRECT?a. Company HD has a higher fixed assets turnover than Company LD.b. Company HD has a lower equity multiplier than Company LD.c. Company HD has a lower total assets turnover than Company LD.d. Company HD has a higher ROE than Company LD.e. Company HD has a lower operating income (EBIT) than Company LD. Enter the complete ionic equation to show the reaction of aqueous lead(II) nitrate with aqueous potassium sulfate to form solid lead(II) sulfate and aqueous potassium nitrate. Express your answer as a chemical equation. Identify all of the phases in your answer. nothing Modify the URL_reader.py program to use urllib instead of a socket. This code should still process the incoming data in chunks, and the size of each chunk should be 512 characters. What is 8.40 in word form Helppppppppppppppppppppp 3. What is the difference between thelongest and shortest distances thegliders flew? An x-ray beam with wavelength 0.170 nm is directed at a crystal. As the angle of incidence increases, you observe the first strong interference maximum at an angle 62.5 . What is the spacing d between the planes of the crystal? Suppose there are only three people in the economy: Jane, Harry, and Bob. The individual demand for corn for each of these consumers is given in Exhibit 3-1. The total quantity demanded of corn if the market price is $5 is Group of answer choices In order to test the feasibility of drying a certain foodstuff, drying data were obtained in a tray dryer with air flow over the top exposed surface having an area of 0.186 m2. The bone dry sample weight was 3.765 kg dry solid. At equilibrium after a long period, the wet sample weight was 3.955 kg (water plus solid). Hence, 3.955-3.765 or 0.190 kg of equilibrium moisture was present. The following table provides the sample weights versus time during the drying test: Time (hr) Weight (kg) Time (hr) Weight (kg) Time (hr) Weight (kg) 0 4.944 2.2 4.554 7.0 4.019 0.4 4.885 3.0 4.404 9.0 3.978 0.8 4.808 4.2 4.241 12.0 3.955 1.4 4.699 5.0 4.150 A) Calculate the free moisture content, X (kg water per kg dry solid) for each data point and plot X versus t; B) Using the slope, calculate the drying rate, R in kg water per hour per square meter and plot R versus X; C) Using this drying rate curve, predict the total time to dry the sample from X = 0.20 to X = 0.04. Use numerical integration in the falling rate period. What is the drying rate in the constant rate period and what is X in the constant rate period? Plz help quick. Find the pH of a solution with an ion concentration [H+] = 3.8x 10^-3Round to the nearest thousands. According to the passage, both of these immigrants moved to Mexico togain an education.pursue creative work.advance in their careers.open their own businesses.THE ANSWER IS C Michelle opened a savings account for her emergency fund. She deposited $2000 into her account, which earns 2.10% interest, compounded monthly. How much will she have in the account after one year? Most of the lymph returns to the venous circulation by way of the Which cultures in the world have shown the most resistance to What kind of economy might a country have if it was influenced by Western thought?Westernization? A spring hangs from the ceiling with an unstretched length of x 0 = 0.69 m x0=0.69 m . A m 1 = 7.5 kg m1=7.5 kg block is hung from the spring, causing the spring to stretch to a length x 1 = 0.84 m x1=0.84 m . Find the length x 2 x2 of the spring when a m 2 = 2.1 kg m2=2.1 kg block is hung from the spring. For both cases, all vibrations of the spring are allowed to settle down before any measurements are made.