Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Give a function run2diff which can be applied to your answer to part (c)(i). When so applied it should give a value in the IO

Give a function run2diff which can be applied to your answer to part (c)(i). When so applied it should give a value in the IO monad which corresponds to ML code that runs add1 twice and returns the difference between the values read. [4 marks] (d) State what happens when attempting to compile and execute the following Java fragment (explaining the origin of any error messages or exceptions which might arise). Object n = new Integer(64), o = new String("Whoops"); Object [] v; Integer [] w = pos([H|T],[H|R]) :- H >= 0, pos(T,R). 6. How many times did users in this network mention other users in their tweets ? (1) 7. How many users follow user 89805 ? (1)8. How many users does user 89805 follow ? (1) 9. Did user 14907 ever retweet user 89805 ? (2)10. Did user 89805 ever retweet user 14907 ? (2)12. What is the total count of followers of followers of user 89805 ? (3) 13. Explore and find some interesting statistic from the data. Print out what you found. (2 a project, in your language of study that meets the following requirements: a record object (also known as entity object, data-transfer object) that uses the column names from the dataset as part of the source code, e.g. variable names, accessors/mutators names, or constants. Use File-IO on startup to open and read the dataset, initializing a few record objects with data parsed from the first few records in the csv file. The record objects should be stored in a simple data structure (array or a list), use exception handling in case the file is missing or not available. Loop over the data structure, and output the record data on screen. baddata.txt 1Applied Problem Solving535.5,Computer Principles for Programmers 633.8,Communicating Across Contexts 88,Introduction to Programming Using C 78.9,Introduction to UNIX/Linux and the Internet 938,Introduction to Database Systems 100,Data Communications Fundamentals 833.3,Introduction to Object Oriented Programming 530,Web Programming Principles 77.2,Advanced Database Services 835.5,Object-Oriented Software Development Using C++ 930,Software Analysis and Design - I35,Web Programming Tools and Framework The formatting details for the attributes printed out are: All labels will be aligned to the right, on a field of exactly 20 characters wide All values will be aligned to the left, on a field of exactly 30 characters wide the label is separated from the value by : (space-colon-space) the filling character is a dot (.) Review the sample_output.txt for hints.A TennisLog is a class that will manage a dynamic array of TennisMatches and keep a count of how many are being stored. This class will define the following member functions: Default constructorA one argument constructor that receives a filename as a parameter (review the file tennis-data.csv to understand its format) from which we will populate the current object. This function will: read the file to count the number of matches in the file (note the heading line in the file is not describing an actual match so do not count that line) allocate dynamic memory for the array of matches based on the number foundreread the file from the beginning to load the actual match data into the array addMatch() is a modifier that receives a TennisMatch object and returns nothing.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Networking A Top-Down Approach

Authors: James Kurose, Keith Ross

7th edition

978-0133594140

More Books

Students also viewed these Computer Network questions