Great Deal! Get Instant $25 FREE in Account on First Order + 10% Cashback on Every Order Order Now

C Programming only. Part 1: (18 points) You will create a program (part1.c) which will open two files whose name will be passed in the command line (example files: File1Dos.txt, File2.Dos.txt or...

1 answer below »

C Programming only.


Part 1: (18 points)

You will create a program (part1.c) which will open two files whose name will be passed in the command line (example files: File1Dos.txt, File2.Dos.txt or File1Unix.txt. File2Unix.txt depending on your OS). You will merge the two files into one (FileMerged.txt) by sorting them.

The merging will happen in the same way as in a mergeSort, i.e. you will read the two current elements, and then pick the smallest and write it to the output file.

The format of File1*.txt, and File2*.txt is

NameOfFileInOneWord numberOfElements

Elements separated by spaces sorted in increasing order.

Your FileMerged.txt will have the same format, i.e. the name, total number of elements will be on the first line, then you will have one line with all the elements sorted in increasing order.

You will use a dynamically allocated array for each of the sequence of elements, i.e. you will have one array to put the content of File1*.txt, one for File2*.txt, and one for merged result . You will create all the functions, i.e. no call to any sorting C library.

Your program will be able to work with any 2 files of that format which is passed to the command line.

Part2: (32 points)

You will create a program (part2.c) which will use a double linked list which will contain integers. You will then create a menu with a loop which will have the following options:

  1. Print the linked list
  2. Insert an element in position x i.e. inserting 3 in position 1 will mean

2->3->4 will become 3->2->3->4

  1. Delete an element by giving it a position number i.e. deleting element 2 from list will mean

2->3->4 will become 2->4

  1. Rotate the linked list by a number, i.e. rotating by 1 means

2->3->4 will become 3->4->2

Rotating by 2 means

2->3->4 will become 4->2->3

The rotation will always be in the same direction.

Your program will use*:

  1. Structures
  2. Pointers to structures
  3. Function pointers for all options of the menu.

I recommend you use one structure for the linked list and another one for passing the arguments to the functions..

I recommend you validate your rotation and your positions, i.e. positive integers, less than the number of elements in the list.

Your structures will be in a file called structPart2.h.

You may use any code that I have given you in any module..

Make sure to look at the list of penalties at the bottom of the assignment.

*: when I say that your program shouldUSEsomething, it means that if I remove it, your program will either not compile, or not work. Having it listed but useless is not enough.

Answered Same DayNov 24, 2021

Solution

Sonu answered on Nov 25 2021
50 Votes
48065 - CPP Menu driven Linked list/Output Screenshots/Output_1.JPG
48065 - CPP Menu driven Linked list/Output Screenshots/Output_2.JPG
48065 - CPP Menu driven Linked list/Output Screenshots/Output_3.JPG
48065 - CPP Menu driven Linked list/Solution Source code/How to open.txt
Hi,
I have develop the source code according to requirement and develop in Visual studio. Please let me know if you need any help.
Also if you know the work flow and how to run the program then please ping or message me,
Whatsapp me:     +91-9767800440
Mail me:    [email protected]
I am waiting for your feedback.
Thanks,
CPP Programming Expert
48065 - CPP Menu driven Linked list/Solution Source code/Part2Solution/.vs/Part2Solution/v16/.suo
48065 - CPP Menu driven Linked list/Solution Source code/Part2Solution/.vs/Part2Solution/v16/Browse.VC.d
48065 - CPP Menu driven Linked list/Solution Source code/Part2Solution/.vs/Part2Solution/v16/ipch/AutoPCH
33bc869974db041/PART2.ipch
48065 - CPP Menu driven Linked list/Solution Source code/Part2Solution/Debug/Part2Solution.exe
48065 - CPP Menu driven Linked list/Solution Source code/Part2Solution/Debug/Part2Solution.ilk
48065 - CPP Menu driven Linked list/Solution Source code/Part2Solution/Debug/Part2Solution.pd
48065 - CPP Menu driven Linked list/Solution Source code/Part2Solution/Part2Solution/Debug/Part2.obj
48065 - CPP Menu driven Linked list/Solution Source code/Part2Solution/Part2Solution/Debug/part2.obj.enc
48065 - CPP Menu driven Linked list/Solution Source code/Part2Solution/Part2Solution/Debug/Part2Solution.log
Part2.c
Part2Solution.vcxproj -> D:\Part2Solution\Debug\Part2Solution.exe
48065 - CPP Menu driven Linked list/Solution Source code/Part2Solution/Part2Solution/Debug/Part2Solution.tlog/CL.command.1.tlog
^D:\PART2SOLUTION\PART2SOLUTION\PART2.C
c /ZI /JMC /nologo /W3 /WX- /diagnostics:column /sdl /Od /Oy- /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /permissive- /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"DEBUG\\" /Fd"DEBUG\VC142.PDB" /Gd /TC /analyze- /FC D:\PART2SOLUTION\PART2SOLUTION\PART2.C
48065 - CPP Menu driven Linked list/Solution Source code/Part2Solution/Part2Solution/Debug/Part2Solution.tlog/CL.read.1.tlog
^D:\PART2SOLUTION\PART2SOLUTION\PART2.C
C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\VC\TOOLS\MSVC\14.22.27905\BIN\HOSTX86\X86\1033\CLUI.DLL
C:\WINDOWS\GLOBALIZATION\SORTING\SORTDEFAULT.NLS
C:\WINDOWS\SYSTEM32\TZRES.DLL
C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT\STDIO.H
C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT\CORECRT.H
C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\VC\TOOLS\MSVC\14.22.27905\INCLUDE\VCRUNTIME.H
C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\VC\TOOLS\MSVC\14.22.27905\INCLUDE\SAL.H
C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\VC\TOOLS\MSVC\14.22.27905\INCLUDE\CONCURRENCYSAL.H
C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\VC\TOOLS\MSVC\14.22.27905\INCLUDE\VADEFS.H
C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT\CORECRT_WSTDIO.H
C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT\CORECRT_STDIO_CONFIG.H
C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT\CONIO.H
C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT\CORECRT_WCONIO.H
C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT\STDLIB.H
C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT\CORECRT_MALLOC.H
C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT\CORECRT_SEARCH.H
C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT\STDDEF.H
C:\PROGRAM FILES (X86)\WINDOWS KITS\10\INCLUDE\10.0.18362.0\UCRT\CORECRT_WSTDLIB.H
C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\VC\TOOLS\MSVC\14.22.27905\INCLUDE\LIMITS.H
48065 - CPP Menu driven Linked list/Solution Source code/Part2Solution/Part2Solution/Debug/Part2Solution.tlog/CL.write.1.tlog
^D:\PART2SOLUTION\PART2SOLUTION\PART2.C
D:\PART2SOLUTION\PART2SOLUTION\DEBUG\VC142.PDB
D:\PART2SOLUTION\PART2SOLUTION\DEBUG\VC142.IDB
D:\PART2SOLUTION\PART2SOLUTION\DEBUG\PART2.OBJ
48065 - CPP Menu...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here