Below is the screenshot of code & output:

Below is the C code for the same. The linked list is also printed for testing:
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
/** struct definition for linked list node **/
struct node{
int id;
char name[100];
double gpa;
struct node* next;
};
/** function to prepend new node to beginning of linked list and return pointer to the prepended linked list **/
struct node* prepend(struct node* linkedlist,struct node* newNode){
newNode->next=linkedlist;
return newNode;
}
/**function to print linked list**/
void print(struct node* linkedlist){
struct node* temp = linkedlist;
while(temp){
printf("%d,%s,%.1lf\n",temp->id,temp->name,temp->gpa);
temp=temp->next;
}
}
int main(int argc, char* argv[]){
/** if file name not given in command line args **/
if(argc!=2){
printf("USAGE: a <filename>\n");
exit(0);
}
FILE* fp = fopen(argv[1],"r");/** to read from file **/
if(fp){
struct node* linkedlist=NULL;/**pointer to our linked list**/
while(!feof(fp)){
struct node* newNode =(struct node*) malloc(sizeof(struct node));
/**inputting node details**/
fscanf(fp,"%d,%[^,]%*c %lf",&(newNode->id),&(newNode->name),&(newNode->gpa));
linkedlist=prepend(linkedlist,newNode);/**prepending node to linked list**/
}
print(linkedlist);/**printing linked list for testing**/
fclose(fp);
}
else{
/** if file not found **/
printf("File \"%s\" not found!\n",argv[1]);
}
}
Write code to read student data from a csv file and add (prepend) that into a...
Java code to read from .csv file i currently have a .csv file that looks like this: 39.743222, -105.006241, Hospital 39.743981, -105.020017, Home 39.739377, -104.984774, Firehouse 39.627779, -104.839291, McDonald's 39.731919, -104.961814, Chipotle I need to write code to extract the doubles from each line to use for my Linked List. this is what i have so far: Scanner in = new Scanner(new FileInputStream(DATA_FILE));
I'm trying to write a java program that will read from two separate text files(course data and class data) and output a result. There will be 3 java files and two txt files. I'll list what I'm trying to do for each: student.java - student object class Attributes: student name major class name course id grade credits course.java - course object class Attributes: course id instructor id room id testStudent.java - class that will create the output Create a report...
Must be written and C, and compile with MinGW. Thank
you!
am Specification For this assignment, you will write a multi-file C program to define, implement and use a dynamic linked lists. Please refer to Lab 07 for the definition of a basic linked list. In this assignment you will need to use the basic ideas of a node and of a linked list of nodes to implement a suit of functions which can be used to create and maintain...
C++ Data Structure Write a program to read a list of students from a file and create a list. The program should use a linked list for implementation. Each node in the linked list should have the student’s name, a pointer to the next student, and a pointer to a linked list of scores. There may be up to four scores for each student.
Write a program that will first receive as input the name of an
input file and an output file. It will then read in a list of
names, id #s, and balances from the input file specified (call it
InFile.txt) which you will create from the data provided below. The
program will then prompt the user for a name to search for, when it
finds the name it will output to a file (call it OFile.txt) the
person’s id#, name,...
WRITE A JAVA PROGRAM THAT READS DATA FROM A .CSV FILE !! PLEASE SEE INSTRUCTIONS BELOW !! BELOW IS THE DATA THAT NEEDS TO BE CONTAINED INTO THE CSV FILE !! employeeId,dbId,privileged,service,inactive,groupmbr,userName,JobFunction,JobFunctionCode,JobFunctionStatus 200,512,TRUE,FALSE,FALSE,PayrollAccess,Bob Fields,Administrator,3000,Active 210,532,TRUE,FALSE,FALSE,AdminAccess,Ann Parson,Administrator,3001,Inactive 220,552,TRUE,FALSE,FALSE,AcctsPayableAccess,Ima Shields,Engineer,1002,Active 230,572,TRUE,FALSE,FALSE,PayrollAccess,Chris Stephens,Administrator,3002,Inactive 211,534,FALSE,FALSE,TRUE,PayrollAccess,Pat Anderson,Developer,2003,Active 212,536,FALSE,FALSE,TRUE,PayrollAccess,Shelley Peterson,Administrator,3003,Inactive 213,538,FALSE,FALSE,FALSE,PayrollAccess,Brian Murray,Engineer,1004,Inactive 214,540,FALSE,FALSE,FALSE,PayrollAccess,Phil Grate,Engineer,1005,Active 221,554,FALSE,FALSE,FALSE,AcctsPayableAccess,Victor Fuzz,Administrator,3004,Inactive 222,556,FALSE,FALSE,FALSE,AcctsPayableAccess,Alan Snow,Developer,2004,Active 223,558,FALSE,FALSE,FALSE,AcctsPayableAccess,Valerie Williams,Administrator,3005,Inactive 224,560,FALSE,FALSE,FALSE,AcctsPayableAccess,Bob Walters,Engineer,1006,Active 231,574,FALSE,FALSE,FALSE,AcctsReceivableAccess,Sue Flynn,Developer,2005,Inactive 233,578,FALSE,FALSE,FALSE,AcctsReceivableAccess,Sean Antonini,Engineer,1007,Active 234,580,FALSE,FALSE,FALSE,AcctsReceivableAccess,Tom Lennon,Administrator,3006,Inactive 300,712,TRUE,TRUE,FALSE,PayrollAccess,John Knight,Administrator,3007,Inactive A PROGRAM THAT READS DATA FROM A CSV FILE AND SHOWS MULTIPLE ENTITLEMENTS. FOR EXAMPLE: Input...
Use the csv file on spotify from any date
Code from lab2
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class SongsReport {
public static void main(String[] args) {
//loading name of file
File file = new File("songs.csv");
//reading data from this file
//scanner to read java file
Scanner reader;
//line to get current line from the
file
String line="";
...
Trying to figure out what needs to be in the headers.h file. I have written the print function. Qualities in header file main() needs insertionSort() and mergeSortWrapper() Both insertionSort() and mergeSortWrapper() need print(). Please copy-and-paste the following files (0 Points): insertionSort.c /*--------------------------------------------------------------------------* *---- ----* *---- insertionSort.c ----* *---- ----* *---- This file defines a function that implements insertion ----* *---- sort on a linked-list of integers. ----* *---- ----* *---- ---- ---- ---- ---- ---- ---- ---- ---- ----* *----...
C++ void CLL::push(char data) { // You write - if the size is 0, add a first node in the linked list // by calling addFirst. Otherwise add a new node to the end of the linked list. Note that this // linked list is circular, so you must make the last node's next pointer point to the first node. } void CLL::addFirst(char data) { // you write - add the very first node to the linked list } void...