Question

Hello Expert, I am stuck on this assignment and can't get my code to run. I...

Hello Expert,

I am stuck on this assignment and can't get my code to run. I would really appreciate it if anyone can help me.

Assignment Requirements:

Your software development company wants to continue developing and enhancing a software for internal use.

For this week's assignment, it is required to read from a JSON application file (data.json) containing employee information. You will not use LINQ for this task.

Your tasks include:

  • Convert the previously created data.txt file into a JSON file
  • Implement JSON functionalities to search, display, and modify the employees' records in the JSON file
  • Meet specifications by displaying on Windows Form Application.

Add the following package to the project at the top of the code. using Newtonsoft.Json;

3) Unzip the attached data.zip file which contains the data.json file.

4) Save the data.json file in a folder where your program can read the file.

5) Read and deserialize the JSON file, per the prototype code below.

//-- access the JSON file with the StreamReader -- using (StreamReader r = new StreamReader("data.json")) { //-- Read the JSON file -- string jsonFile = r.ReadToEnd(); //-- Deserialize the JSON format into List object -- Week4List = JsonConvert.DeserializeObject>(jsonFile); }

6) Continue to use the sub classes for the W2 and 1099 employees that inherits the employee data.

7) Remove the filter so all data will show.

8) Include fields and calculations for AnnualTax and AnnualNetPay in the output display. Display the data for the employees on a Windows Form using the ListView control.

Note that I will accept the output in a Console window, but a Form is preferred.

Homework Answers

Answer #1

Thanks for the question.


Below is the code you will be needing Let me know if you have any doubts or if you need anything to change.


Thank You !!


===========================================================================

In python 3, we can use below method.

#Read from file and convert to JSON

import json

# Considering "json_list.json" is a json file

with open('json_list.json') as fd:
     json_data = json.load(fd)

or

import json

json_data = json.load(open('json_list.json'))

Using with statement will automatically close the opened file descriptor.

String to JSON

import json

json_data = json.loads('{"name" : "myName", "age":24}')

Let me know for any question or help.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Hello, I am trying to do an assignment that requires writing an MSP432 code to add...
Hello, I am trying to do an assignment that requires writing an MSP432 code to add two 64 bit numbers together and store the result in memory location 0x2000_0000. The problem is that the it is a 32 bit register. I don't know how to add to a load 64 bit numbers. The question is below but please feel free to use your own examples, I will understand better. Thank you very much. Write a small MSP432 code segment that...
Hello, I feel like I am super close but I can not figure out why my...
Hello, I feel like I am super close but I can not figure out why my C++ code it not displaying the proper medium. Thank you! Here is an example of the output: Input : a[] = {1, 3, 4, 2, 6, 5, 8, 7} Output : Mean = 4.5 Median = 4.5 Code so far:   #include <iostream> using namespace std; int main() { int a[100]; int n,i,sum=0; float mean, medium; //read array size // read array cout<<"Enter array size:...
My assignment is listed below. I already have the code complete, but I cannot figure out...
My assignment is listed below. I already have the code complete, but I cannot figure out how to complete this portion: You must create a makefile to compile and build your program. I can't figure out if I need to create a makefile, and if I do, what commands do I use for that? Create a  ContactInfo class that contains the following member variables: name age phoneNumber The ContactInfo class should have a default constructor that sets name = "", phoneNumber...
can someone edit my c++ code where it will output to a file. I am currently...
can someone edit my c++ code where it will output to a file. I am currently using xcode. #include <iostream> #include <cctype> #include <cstring> #include <fstream> using namespace std; bool inputNum(int [],int&,istream&); void multiply(int[],int,int[],int,int[],int&); void print(int[],int,int,int); int main() {ifstream input; int num1[35],num2[35],len1,len2,num3[60],len3=10,i; input.open("multiplyV2.txt"); //open file if(input.fail()) //is it ok? { cout<<"file did not open please check it\n"; system("pause"); return 1; }    while(inputNum(num1,len1,input)) {inputNum(num2,len2,input); multiply(num1,len1,num2,len2,num3,len3); print(num1,len1,len3,1); print(num2,len2,len3,2); for(i=0;i<len3;i++) cout<<"-"; cout<<endl; print(num3,len3,len3,1); //cout<<len1<<" "<<len2<<" "<<len3<<endl; cout<<endl;    } system("pause"); } void...
Using JAVA For this assignment, you will analyze code that uses a file input stream and...
Using JAVA For this assignment, you will analyze code that uses a file input stream and a file output stream. Read through the linked Java™ code. In a Microsoft® Word document, answer the following questions: Could this program be run as is? If not, what is it lacking? Does this program modify the contents of an input stream? In what way? What are the results of running this code? ********************************************** CODE TO ANALYZE  ******************************************************** /********************************************************************** *   Program:   Datasort *   Purpose:   ...
Manipulating structured data Purpose This two-part assignment involves manipulating "structured" data, similar to what might be...
Manipulating structured data Purpose This two-part assignment involves manipulating "structured" data, similar to what might be analyzed with a spreadsheet. This first part requires you to develop pseudocode, which allows you to think about the operations needed without having to follow precise C++ syntax. Pseudocode captures the major operations such as initializations, calculations, loops and decisions. Assignment 6 provided a pseudocode example. The second part of this assignment will translate the pseudocode into C++. The problem Every week a company...
Part A. Input Validation (Name your C program yourLastName_yourFirstName_Lab4a.c) 1. Place the code you developed in...
Part A. Input Validation (Name your C program yourLastName_yourFirstName_Lab4a.c) 1. Place the code you developed in Lab 2 to obtain a diameter value from the user and compute the volume of a sphere (we assumed that to be the shape of a balloon) in a new program, and implement the following restriction on the user’s input: the user should enter a value for the diameter which is at least 8 inches but not larger than 60 inches. Using an if-else...
Use the Donor database attached to the assignment answer the following: Question 1: Create a block...
Use the Donor database attached to the assignment answer the following: Question 1: Create a block to retrieve and display pledge and payment information for a specific donor. For each pledge payment from the donor, display the pledge ID, pledge amount, number of monthly payments, payment date, and payment amount. The list should be sorted by pledge ID and then by payment date. For the first payment made for each pledge, display “first payment” on that output row. 2 marks...
Hello! I'm getting this assignment wrong according to the cengage software. The code looks right to...
Hello! I'm getting this assignment wrong according to the cengage software. The code looks right to me but apparently it is not. May someone please take a look at it and let me know what I'm doing wrong. I just can't seem to find the error. I'm attaching the question below and below that I will attach my code. I appreciate any help you could provide. The book is: HTML5, CSS3, and JavaScript, 6th edition, Bundle Thanks QUESTION: General Flex...
I did already posted this question before, I did get the answer but i am not...
I did already posted this question before, I did get the answer but i am not satisfied with the answer i did the code as a solution not the description as my solution, so i am reposting this question again. Please send me the code as my solution not the description In this project, build a simple Unix shell. The shell is the heart of the command-line interface, and thus is central to the Unix/C programming environment. Mastering use of...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT