Question: 4 . 1 1 LAB: Mileage tracker for a runner Given the MileageTrackerNode class, complete main ( ) in the MileageTrackerLinkedList class to insert nodes
LAB: Mileage tracker for a runner
Given the MileageTrackerNode class, complete main in the MileageTrackerLinkedList class to insert nodes into a linked list
using the insertAfter method The first userinput value is the number of nodes in the linked list. Use the printNodeData method to print
the entire linked list. DO NOT print the dummy head node.
Ex If the input is:
the output is:
import java.util.Scanner;
public class MileageTrackerLinkedList
public static void main String args
Scanner scnr new ScannerSystemin;
References for MileageTrackerNode objects
MileageTrackerNode headNode;
MileageTrackerNode currNode;
MileageTrackerNode lastNode;
double miles;
String date;
int i;
Front of nodes list
headNode new MileageTrackerNode;
lastNode headNode;
TODO: Scan the number of nodes
TODO: For the scanned number of nodes, scan
in data and insert into the linked list
TODO: Call the printNodeData method
to print the entire linked list
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
