Preview

Advantages of Science

Good Essays
Open Document
Open Document
788 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Advantages of Science
Assignment #3

WAQAR AHMED KHAN
(5757)

Q1. Write a function power ( a, b ), to calculate the value of a raised to b. static void Main(string[] args) { Console.WriteLine("enter number with power is to be calculated"); int a = Convert.ToInt16(Console.ReadLine()); Console.WriteLine("enter power"); int b = Convert.ToInt16(Console.ReadLine()); Program p = new Program(); double c=p.power(a, b); Console.WriteLine(a+ " rase to the power "+b+ "="+c);

}

private double power(int a, int b) { double power = Math.Pow(a, b); return power;

}

Q2. Write a general-purpose function to convert any given year into its roman equivalent.
Example:
Roman equivalent of 1988 is mdcccclxxxviii
Roman equivalent of 1525 is mdxxv

static void Main(string[] args) { Console.WriteLine("enter the year"); int number=Convert.ToInt16(Console.ReadLine());

Program p=new Program(); string samsung=p.ToRoman(number); Console.WriteLine(samsung); }

private string ToRoman(int number) { if ((number < 0) || (number > 3999)) throw new ArgumentOutOfRangeException("insert value betwheen 1 and 3999"); if (number < 1) return string.Empty; if (number >= 1000) return "M" + ToRoman(number - 1000); if (number >= 900) return "CM" + ToRoman(number - 900); if (number >= 500) return "D" + ToRoman(number - 500); if (number >= 400) return "CD" + ToRoman(number - 400); if (number >= 100) return "C" + ToRoman(number - 100); if (number >= 90) return "XC" + ToRoman(number - 90); if (number >= 50) return "L" + ToRoman(number - 50); if (number >= 40) return "XL" + ToRoman(number - 40); if (number

You May Also Find These Documents Helpful

  • Satisfactory Essays

    unit 3

    • 313 Words
    • 2 Pages

    4. Assume the variables result, w, x, y , and z are integers, and that w=5, x=4, y=8, and z=2. What value will be stored in result in each of the following statements?…

    • 313 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Going in this lecture I was a little apprehensive because I am not a nurse or science major. I wanted to be able to get something out of it. I did not want it to be a long, boring, and uneventful lecture. But to my surprise it was not! To quickly sum up which lecture I went to, it was in Smith Hall by Dr. James Peterson talking about “Human Gene Editing Now: The National Academy of Science’s Pursuit of What We Should Do.” Dr. James Peterson first began to talk about nature and how God admired nature. He asked us if our we had a garden would be not improve and restore it. Dr. James Peterson then compared the garden to our bodies. He again said we need to sustain what we have. When talking about nature he also stated the importance of relationships,…

    • 263 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Variable and Meal Price

    • 1236 Words
    • 9 Pages

    5.) When an argument is passed by reference, the module can modify the argument in the…

    • 1236 Words
    • 9 Pages
    Satisfactory Essays
  • Good Essays

    In my family there is a tradition of interest in science: my grandmother was college professor in chemistry and physics, and both my parents were trained as mechanical engineers in college. When I was a kid, my mom showed me a box full of extremely tiny gears — those that table clocks are made out of — and told me what each…

    • 781 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Advantages of Technology

    • 405 Words
    • 2 Pages

    Over the past few years, technology has been changing and expanding in every way possible. Even though it might seem like todays technology has reached its limits, that is far from the truth. It was only about twenty years ago that "personal computers" became small enough and affordable enough to buy and use. Ever since, technology has been changing peoples lives for the better.…

    • 405 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    We cannot Say for certain whether science is a curse or a blessing. it is our use of science which would make science a curse or a Blessing . First let us see how man has used science for his good so that it has become a blessing for him. it is science that has provided modern man the life of ease, leisure and pleasure. It has brought within reach of the common man comforts and luxuries which were available in the past only to a privileged few.…

    • 429 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    My mandate, as I understood it, was to sketch the principal orientation of peoples in the capitalist democracies of North America and Europe to the human rights issues implicated in the constantly growing capacity of men and women to manipulate the natural world and to influence virtually every aspect of human life in ways hardly imagined just a few decades ago.…

    • 15396 Words
    • 62 Pages
    Powerful Essays
  • Better Essays

    How can science and technology help to resolve or prevent conflicts and thus help the cause of peace?…

    • 2446 Words
    • 10 Pages
    Better Essays
  • Good Essays

    Science in Daily Life

    • 2421 Words
    • 10 Pages

    [pic]The largest creature ever known to have existed on Earth is the present-day blue whale. The largest dinosaur attained a length of about 22 m and weighed about 36 tons. Today’s blue whale is even larger than its ancestors, and may reach a total length of 33 m and a weight of 145 tons.…

    • 2421 Words
    • 10 Pages
    Good Essays
  • Satisfactory Essays

    Science has brought many changes in the world today.It is used in all the corners of tScience has brought many changes in the world today.It is used in all the corners of the world for the benefit of man.…

    • 350 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Disadvantages of Science

    • 1077 Words
    • 5 Pages

    Science cannot explain many supernatural and super-civilization phenomena. For example, we often ask what it is out of our universe, and what it is out of that universe which is already out of our universe. When asking many times, we finally believe that the question must be explained based on philosophy knowledge. However, philosophy is more like a way of thinking, but not a specific method. Just like working out a math problem, philosophy is just an idea of solving, like normalization and infinitesimal. But only having idea cannot give out the answer after all, we need to use concrete formulas and at last work out the answer. But now, many super phenomena cannot be explained clearly with latter way: in a concrete way, but not only use philosophy. Review the history of human's science explorations; I found that mankind's science has two features: concrete and material. Our science is based on materials and matter of the world, from atoms to cosmos, all science aspects stick to them firmly; and our science is entirely concrete, all our scientific ideas must be shown in the forms of laws, rules or mathematical formulas. These two features have their own advantages, nevertheless, we have two admit they have been, and now are limiting human being's way of exploring natural world. Because many supernatural phenomena suggest that some things happened out of the way of logic of today's science. Only use our science based on concrete and material, they all seem to be disobey the laws of science. Because they are not fit in any formulas; in other words, sometimes science with formulas and laws cannot fit in changeable and unstable nature, which is called supernatural and super-civilization phenomena. Maybe this kind of natural thing has no formula to explain but also have their own rules? Consequently, there must be another type of subject, which is higher than science to explain super phenomena. And it is not based on laws or formulas, which are…

    • 1077 Words
    • 5 Pages
    Good Essays
  • Good Essays

    Science has been with us ever since our ancestors were barely civilized. It has simplified our lives to the extent that not only has it brought about positive effects but negative effects as well. Science is all around us, from the trash gathered in our waste basket to the chair, table and computer you are using to read this essay right now. To put it simply, as we continue our evolution, knowingly or unknowingly, the more we discover things through science and more change will be brought into our lives, whether we like it or not.…

    • 419 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Science is very useful yo us. It’s discoveries and inventions make our life comfortable in many ways. They have given us better and quicker means of transport. Trains, buses, cars, aeroplanes, helicopters, ships, electric trains and auto-rickshaws help us to move from one place to another very quickly. Before their appearances people move from one place to another mainly on walk. The rich travelled by the coaches drawn by horses and several men rode upon horses, ponies and camels. They also used carts drawn by bulls and jutkas to travel short distances. They took a long time to reach their destinations. But by trains, motor-cars, ships and planes they travel long distances within a few hours or days. They seem to have brought different parts of the world closer to one another. The mariner’s compass and the satellites orbiting the earth help them to know the weather conditions, the approach of a storm or a cyclone and the heavy or moderate rainfall. They are able to warm the fishermen in the time against going to sea when there are symptoms of as storm upon the sea. There are scientific instruments to fathom the depth of the ocean the temperature and the air-pressure at different depths and the various kinds of sea-creatures and sea-plants. This knowledge gives hope to mankind if the earth fails to provide adequate food to humanity they turn to the sea-life for food. In the field of communications, science has given us wonderful aids in the shape of the telephone, the wireless trelegraphy, the radio, the cable and the Television. They help us to communicate with the people who are far away from us. The transport media say, into a small district. Science has enhanced the nature of our entertainments. It has given the radio, the television, and the cinema. Both of them can be used not only for entertainment but also for audio-visual education. With the progress made by medical science, we find that it diagnoses diseases more…

    • 862 Words
    • 4 Pages
    Good Essays
  • Good Essays

    Technology has been progressing at an astonishingly rapid rhythm, and it has been changing our lives in a scaring way. In the future, our lives might change even more, with several benefits and dangers of technological advances. Everything evolves around 3 concepts: technology, science and future.…

    • 804 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    Importance of Science

    • 2550 Words
    • 11 Pages

    Modern science and technology have changed our lives in many dramatic ways. Airplanes, automobiles, communications satellites, computers, plastics, and television are only a few of the scientific and technological inventions that have transformed human life. Research by nuclear physicists has led to the development of nuclear energy as a source of power. Agricultural scientists have developed better varieties of plants and highly effective fertilizers. The development of antibiotics and other new drugs has helped to control many infectious diseases. Studies in anatomy and physiology have led to amazing new surgical operations and to the invention of lifesaving machines that can do the work of such organs as the lungs, kidneys, and heart.…

    • 2550 Words
    • 11 Pages
    Powerful Essays

Related Topics