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...
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...
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...
The project CreateDirectoriesDemo is included with the files for this chapter as a zipped file. rewrite...
The project CreateDirectoriesDemo is included with the files for this chapter as a zipped file. rewrite the program so that it asks the user for the location where the new directories are to be created, and then asks the user to enter, one at a time, the relative path names of the directories it should create. Amended additional details to the above abstraction of the requirements. The application should be multiplatform adaptive. This means that it should work on an...
I'm currently stuck on Level 3 for the following assignment. When passing my program through testing...
I'm currently stuck on Level 3 for the following assignment. When passing my program through testing associated with the assignment it is failing one part of testing.   Below is the test that fails: Failed test 4: differences in output arguments: -c input data: a b c -c expected stdout: b observed stdout: a b expected stderr: observed stderr: ./test: invalid option -- 'c' Unsure where I have gone wrong. MUST BE WRITTEN IN C++ Task Level 1: Basic operation Complete...
The decimal values of the Roman numerals are: M D C L X V I 1000...
The decimal values of the Roman numerals are: M D C L X V I 1000 500 100 50 10 5 1 Remember, a larger numeral preceding a smaller numeral means addition, so LX is 60. A smaller numeral preceding a larger numeral means subtraction, so XL is 40. Assignment: Begin by creating a new project in the IDE of your choice. Your project should contain the following: Write a class romanType. An object of romanType should have the following...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT