Coder Social home page Coder Social logo

scala-collection-assignments-'s Introduction

scala-collection-assignments-

Assignemnt 1) Every Student has some marks associated with it. Student details contains its id and name. And for Marks, there are subjectId, studentId and number of marks a student scored.

Following are the requirements which is required to gain from above scenario (i.e. Student and marks)

Input:- (subjectId, percentage, pass/fail) Output:- for input pass, evaluate that how much students(id, name) are passed in the inputted subjectId for input fail, evaluate that how much students(id, name) are failed in the inputted subjectId Note:- percentage is the input which defines the minimum passing criteria e.g. Pass count: 15 Fail count: 10

Input:- (subjectId, count, top/bottom) Output:- based on the last input(top/bottom), output the students details who have scored max/min in that subjectId e.g. input: 1 5 top output: Kunal 85 Himanshu 84 Geetika 83 Anmol 82 Mahesh 81

Input:- (top/bottom, count) OutPut:- Overall top/least scorer based on all the subjects score, fetch students name count- input defines that how much students name are to be printed on console e.g. input: top 2

output: Himanshu 75% Geetika 74%

Input:- (percentage, good_scholarship, normal_or_no_scholarship) Output:- two groups of students with the amount of scholarship e.g. input: 85% 2000 500 output: Kunal 2000 Himanshu 500 Geetika 2000 Mahesh 500

Input:- (pass/fail, percentage) count and print the number of students and all names who are passed/fail, Pass or fail would be decided by percentage input field. e.g. input: fail 30 output: Kunal 28% Himanshu 29%

  1. Find the student(s) who have scored 95% or above and print its details. input: 95% output: Kunal 95% Himanshu 96% Geetika 97%

  2. For every student, find its marks in detail (just like detailed Report card of a student.) Note:- must use groupBy method of List input: reportcard output: Kunal 75 70 80 75 75% Himanshu 74 70 81 75 75% Geetika 70 70 85 75 75%

Developer Notes:

There would be two case classes

  1. Student(id: Long, name: String)
  2. Marks(subjectId: Int,studentId: Long, marksObtained: float)

In order to fill data in those case classes, either take inputs from a file, or take static inputs. But there must be atleast 5 subjects, and atleast 10 students. e.g. List(Student(1, "Kunal"), Student(2, "Himanshu"), Student(3, "Geetika") ....) List(Marks(1, 1, 95), Marks(2, 1, 75), ...) So basically here Kunal has marks 95 and 75 for the paper 1 and 2 respectively.

Assignemnt 2)

  • Find the last element of list with its index value(dont use inbuilt methods to extract last element directly)
  • print the table of each element in the List
  • aggregate the contents of two lists of same size into a single list List(1,2) and List("a", "b") results List(List(1, "a"), List(2, "b"))
  • find sum and multiplication of the list (dont use inbuilt methods)
  • apply quicksort and mergesort on the Lists
  • implement Stack and Queue using Lists.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.