1. Create a function that takes a vector of numerics as input. It checks the length of the vector. If the length is even, it returns the sum of the vector. If the length is odd, it returns the sum of all of the even numbers of the vector. You may call your function numsum (). Evaluate your function on each of the following vectors:
– c(1, 2, 3, NA)
– c(1, 2, 3)
– c(2, 3, 4, 5, 6)
– c(2, 3, 4, 5, NA)
– c(2, 3, 4, NA, 6)
2. We add a Leap Day on February 29, almost every four years. In the Gregorian calendar three criteria must be taken into account to identify leap years:
– The year can be evenly divided by 4, is a leap year, unless:
– The year can be evenly divided by 100, it is NOT a leap year, unless:
– The year is also evenly divisible by 400. Then it is a leap year.
This means that in the Gregorian calendar, the years 2000 and 2400 are leap years, while 1800, 1900, 2100, 2200, 2300 and 2500 are NOT leap years
Write a function that takes the year as input and returns TRUE if it is a leap year and FALSE if it is not a leap year. Evaluate your function at 2, 12, 200, 800.
3. Create a function that takes two vectors of numerics as input, a and b.
– Your vector should throw an error if either a or b contain repeated elements.
– If a number is in a and not b you add 1 to your score.
– If a number is in b and not a you subtract 1 from your score.
– If a number is in both a and b you do nothing to your score.
– The function returns the final score.
– You may name your function abscore()
– Hint: help("%in%")
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme