Saturday, February 29, 2020
Advantages of Science
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; f (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 = 10) return ââ¬Å"Xâ⬠+ ToRoman(number ââ¬â 10); if (number = 9) return ââ¬Å"IXâ⬠+ ToRoman(number ââ¬â 9); if (number = 5) return ââ¬Å"Vâ⬠+ ToRoman(number ââ¬â 5); if (number = 4) return ââ¬Å"IVâ⬠+ ToRoman(number ââ¬â 4); if (number = 1) return ââ¬Å"Iâ⬠+ ToRoman(number ââ¬â 1); throw new ArgumentOutOfRangeException(ââ¬Å"something bad happenedâ⬠); } Q3. Any year is entered through the keyboard. Write a function to determine whether the year is a leap year or not. static void Main(string[] args) { Console. WriteLine(ââ¬Å"enter the yearâ⬠); int a = Convert. ToInt16(Console. ReadLine()); Program p=new Program(); . leap(a); } private void leap(int a) { if (a%4! =0 a%100==0 a%400==0) { Console. WriteLine(ââ¬Å"this year is a lea p yearâ⬠); } else Console. WriteLine(ââ¬Å"this is not a leap yearâ⬠); } Q4. Write a function that receives 5 integers and returns the sum, average and standard deviation of these numbers. int a, b, c, d, e; Console. WriteLine(ââ¬Å"enter first numberâ⬠); a = Convert. ToInt16(Console. ReadLine()); Console. WriteLine(ââ¬Å"enter second numberâ⬠); b = Convert. ToInt16(Console. ReadLine()); Console. WriteLine(ââ¬Å"enter third numberâ⬠); c = Convert. ToInt16(Console. ReadLine()); Console. WriteLine(ââ¬Å"enter forth numberâ⬠); = Convert. ToInt16(Console. ReadLine()); Console. WriteLine(ââ¬Å"enter fifth numberâ⬠); e = Convert. ToInt16(Console. ReadLine()); Program p = new Program(); int f = p. sum(a, b, c, d, e); int g = p. average(f); double h = p. standard_deviation(a, b, c, d, e, f, g); Console. WriteLine(ââ¬Å"sum of numbers are=â⬠+f); Console. WriteLine(ââ¬Å"averge of numbers are=â⬠+g); Console. WriteLine(ââ¬Å"stardard deriva tion of numbers is=â⬠+h); } private double standard_deviation(int a, int b, int c, int d, int e, int f, int g) { double i, j, k, l, m,deri,squ; i = a ââ¬â g; j = b ââ¬â g; k = c ââ¬â g; l = d ââ¬â g; m = e ââ¬â g; i = Math. Pow(i, 2); j = Math. Pow(j, 2); = Math. Pow(k, 2); l = Math. Pow(l, 2); m = Math. Pow(m, 2); deri = (i + j + k + l + m) / g; squ = Math. Sqrt(deri); return squ; } private int average(int f) { int avg = f / 5; return avg; } private int sum(int a, int b, int c, int d, int e) { int sum = a + b + c + d + e; return sum; } Q5. If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. int sum = 0; for (int i = 3; i 1000; i++) { if (i % 3 == 0 || i % 5 == 0) { sum += i; Console. WriteLine(sum. ToString()); } Q6. A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99. Find the largest palindrome made from the product of two 3-digit numbers. int maxPalindrome = 0; for (int i = 100; i 1000; i++) { for (int j = i; j 1000; j++) { int product = i * j; if (product. IsPalindrome() product maxPalindrome) { maxPalindrome = product; } } } System. Console. WriteLine(maxPalindrome); } } public static class Extensions { public static bool IsPalindrome(this int i) { Listchar chars = new Listchar(i. ToString(). ToCharArray()); chars. Reverse(); return i == int. Parse(new string(chars. ToArray())); Advantages of Science 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; f (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 = 10) return ââ¬Å"Xâ⬠+ ToRoman(number ââ¬â 10); if (number = 9) return ââ¬Å"IXâ⬠+ ToRoman(number ââ¬â 9); if (number = 5) return ââ¬Å"Vâ⬠+ ToRoman(number ââ¬â 5); if (number = 4) return ââ¬Å"IVâ⬠+ ToRoman(number ââ¬â 4); if (number = 1) return ââ¬Å"Iâ⬠+ ToRoman(number ââ¬â 1); throw new ArgumentOutOfRangeException(ââ¬Å"something bad happenedâ⬠); } Q3. Any year is entered through the keyboard. Write a function to determine whether the year is a leap year or not. static void Main(string[] args) { Console. WriteLine(ââ¬Å"enter the yearâ⬠); int a = Convert. ToInt16(Console. ReadLine()); Program p=new Program(); . leap(a); } private void leap(int a) { if (a%4! =0 a%100==0 a%400==0) { Console. WriteLine(ââ¬Å"this year is a lea p yearâ⬠); } else Console. WriteLine(ââ¬Å"this is not a leap yearâ⬠); } Q4. Write a function that receives 5 integers and returns the sum, average and standard deviation of these numbers. int a, b, c, d, e; Console. WriteLine(ââ¬Å"enter first numberâ⬠); a = Convert. ToInt16(Console. ReadLine()); Console. WriteLine(ââ¬Å"enter second numberâ⬠); b = Convert. ToInt16(Console. ReadLine()); Console. WriteLine(ââ¬Å"enter third numberâ⬠); c = Convert. ToInt16(Console. ReadLine()); Console. WriteLine(ââ¬Å"enter forth numberâ⬠); = Convert. ToInt16(Console. ReadLine()); Console. WriteLine(ââ¬Å"enter fifth numberâ⬠); e = Convert. ToInt16(Console. ReadLine()); Program p = new Program(); int f = p. sum(a, b, c, d, e); int g = p. average(f); double h = p. standard_deviation(a, b, c, d, e, f, g); Console. WriteLine(ââ¬Å"sum of numbers are=â⬠+f); Console. WriteLine(ââ¬Å"averge of numbers are=â⬠+g); Console. WriteLine(ââ¬Å"stardard deriva tion of numbers is=â⬠+h); } private double standard_deviation(int a, int b, int c, int d, int e, int f, int g) { double i, j, k, l, m,deri,squ; i = a ââ¬â g; j = b ââ¬â g; k = c ââ¬â g; l = d ââ¬â g; m = e ââ¬â g; i = Math. Pow(i, 2); j = Math. Pow(j, 2); = Math. Pow(k, 2); l = Math. Pow(l, 2); m = Math. Pow(m, 2); deri = (i + j + k + l + m) / g; squ = Math. Sqrt(deri); return squ; } private int average(int f) { int avg = f / 5; return avg; } private int sum(int a, int b, int c, int d, int e) { int sum = a + b + c + d + e; return sum; } Q5. If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. int sum = 0; for (int i = 3; i 1000; i++) { if (i % 3 == 0 || i % 5 == 0) { sum += i; Console. WriteLine(sum. ToString()); } Q6. A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99. Find the largest palindrome made from the product of two 3-digit numbers. int maxPalindrome = 0; for (int i = 100; i 1000; i++) { for (int j = i; j 1000; j++) { int product = i * j; if (product. IsPalindrome() product maxPalindrome) { maxPalindrome = product; } } } System. Console. WriteLine(maxPalindrome); } } public static class Extensions { public static bool IsPalindrome(this int i) { Listchar chars = new Listchar(i. ToString(). ToCharArray()); chars. Reverse(); return i == int. Parse(new string(chars. ToArray()));
Thursday, February 13, 2020
Ethical interview Coursework Example | Topics and Well Written Essays - 500 words
Ethical interview - Coursework Example From this illustration, it is evident that this method is not only used the moment a partner dies (Garcia, 2001). From the matter and hand, Karen Capato who used has husbands through the Vitro fertilization gave a result of twins. It is a fact that some children have been denied a right of accessing the heritage on how they were born. The governing bodies have to propose a bill that advocates genetically manipulated children to find and understand how they came into existence and to gain their inheritance. The attitude and the perception by the state not to recognize these children as humans even though they are issued with the birth certificates is an overwhelming factor that needs to be eliminated. Despite technology being used, what matters is that the result that will be generated is a human being. Putting these children in the state of doubt makes them lose confident of themselves being in mind their conception was as natural as compared to the other kids (Salumets, 2003). Globally, the matter grown to a higher level because the number of children produced with the assistance of technology has continued to grow. Its growth has gotten a bigger number of complex ethical issues especially those that are associated with the matter at hand. When it comes to the social security benefits entitlement for these children conceived through means, I suggest that there should be some limits in the decision that are proposed by the supreme courts. For the limit to be implemented there must be considerations and according to my opinion, I suggest this by the use of utilitarian ethical theory and the principle of fairness (SANKAI, 2000). When children are conceived using genetic manipulation, there are legal difficulties that that compounds the individual to gain the inheritance. Through applying the principle of justice, we focus on the equitability of the distributional risks because of the limited resources available. The
Saturday, February 1, 2020
The Strengths and Limitations of the Universalist and the Contingency Essay
The Strengths and Limitations of the Universalist and the Contingency Approaches to HR Strategy - Essay Example This research will begin with the statement that every organization has certain vision mission, vision, goals, and objectives. The vision and mission of the organization are attained with the help of the organization's goals or objectives. The vision and the mission statement the ultimate reason for the survival of the organization. Thus the objectives and goal which are decided after considering the mission and objective of the organization are utmost important. Goal attainment is very important for the survival and the growth of the organization. To attain the goals of the organization the management takes various types of strategies. These strategies are implemented at the various level of the organization. The managerial strategies ranges consist of various corporate-level strategies, business level strategies and the last but not the least the human resources strategies. Human resource is a very important and vital aspect of the organization. It is the human resources which ulti mately implement the entire plan into action and drive the organization to achieve the goals of the organization. Strategic human resource management is a vital part of organizational management. Management uses various manage the human resource efficiently and effectively. The different activities under human resource strategies are aimed at various actions at policies which can influence human resource management. The process of managing human resource includes the hiring of the efficient and quality candidates, designing jobs, job description, job allocation, other human resource policies etc. All theses process directly affects the overall performance of the organization. The two important approaches to human resource strategy are Universalist and Contingency approaches.
Subscribe to:
Comments (Atom)