MSU Programming Datatype to Represent Student Grade Questions

Description

2 attachmentsSlide 1 of 2attachment_1attachment_1attachment_2attachment_2

Unformatted Attachment Preview

1. Create a datatype to represent student grade, with id (int) and grade (int option) as
attributes. Write a function to accept a student grade and returns pass or fail based on
pass mark of 75. Use a custom datatype to denote pass or fail.
2. Write a function that takes a list of students’ grade results and nal grades. Returns the
number of misgrades. A misgrade is when the student gets > 75 but marked fail and vice
versa.
Input
Return Value
[(fail, {id = 1, grade=88}), (pass, {id = 2,
grade=68}), (pass, {id = 3, grade=95})]
2
3. Write a recursive function that takes a string (inputString) and a list of strings (inputList) and
returns SOME of list of strings that contains all the strings in inputList with the exception of
inputString. Should return NONE if the inputString is not present in the inputList. Calling the
function with (“Xing”, [“Hello”, “Xing”, “World”]) should return SOME [“Hello”,”World”].
Where as calling the function with (“Ra “, [“Hello”, “Xing”, “World”]) should return NONE.
4. Write a function that returns names substitutions. It takes string list list and a
string as input. The rst input is a list of list of name equivalents, and the second input is
a name. The function returns a list of names that can be substitutes for the name passed in.
Given below are inputs and expected return values:
Input
Return Value
[[“Sitha”, “Seetha”, “Sita”], [“Lakshman”,
“Laxman”, “Lucky”], [“Jacob”, “Jake”, “Jack”]],
“Jacob”
[“Jake”, “Jack”]
The returned list can contain duplicates. Make use of the function written for 1 and inbuilt @
operator for appending to lists.
5. Write a tail recursive version for problem 1.
6. Write a tail recursive version for problem 2.
7. Create a datatype that has attributes rst name, middle name and last name. Write a
function that accepts string list list (list of list of name equivalents), and a full name, and
returns list of equivalent full names. The returned list includes the full name sent as input.
Equivalent names are found only for rst names. Duplicate values are OK.
Input
Return Value
fi
fi
fi
fi
fi
[[“Sitha”, “Seetha”, “Sita”], [“Lakshman”, “Lucky”], [{fn:”Lakshman”, ln:”Dev”, mn: “Kumar”},
[“Jacob”, “Jake”, “Jack”]], {fn:”Laxman”, ln:”Dev”, {fn:”Laxman”, ln:”Dev”, mn: “Kumar”}, {fn:”Lucky”,
mn: “Kumar”}
ln:”Dev”, mn: “Kumar”}]

Purchase answer to see full
attachment

Explanation & Answer:
7 Questions

Tags:
programming

java

datatype to represent student grade

User generated content is uploaded by users for the purposes of learning and should be used following Studypool’s honor code & terms of service.

Reviews, comments, and love from our customers and community:

Article Writing

Keep doing what you do, I am really impressed by the work done.

Alexender

Researcher

PowerPoint Presentation

I am speechless…WoW! Thank you so much!

Stacy V.

Part-time student

Dissertation & Thesis

This was a very well-written paper. Great work fast.

M.H.H. Tony

Student

Annotated Bibliography

I love working with this company. You always go above and beyond and exceed my expectations every time.

Francisca N.

Student

Book Report / Review

I received my order wayyyyyyy sooner than I expected. Couldn’t ask for more.

Mary J.

Student

Essay (Any Type)

On time, perfect paper

Prof. Kate (Ph.D)

Student

Case Study

Awesome! Great papers, and early!

Kaylin Green

Student

Proofreading & Editing

Thank you Dr. Rebecca for editing my essays! She completed my task literally in 3 hours. For sure will work with her again, she is great and follows all instructions

Rebecca L.

Researcher

Critical Thinking / Review

Extremely thorough summary, understanding and examples found for social science readings, with edits made as needed and on time. Transparent

Arnold W.

Customer

Coursework

Perfect!

Joshua W.

Student

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>