×
Samples Blogs Make Payment About Us Reviews 4.9/5 Order Now

Java Program to Create Hot Dog Consolidated Hiring System Assignment Solution

June 23, 2024
Dr. Ethan Taylor
Dr. Ethan
🇬🇧 United Kingdom
Java
Dr. Ethan Taylor holds a Ph.D. in Computer Science from the University of Oxford. With over 850 assignments completed, he brings extensive expertise in data structures, algorithms, and programming languages. Ethan specializes in array manipulation, dynamic memory allocation, and algorithm optimization, providing students with comprehensive guidance and practical solutions for their Array class interface homework.
Key Topics
  • Instructions
    • Objective
  • Requirements and Specifications
Tip of the day
Start with basic image processing concepts like color spaces and transformations. Practice simple OpenCV examples to build confidence before tackling complex tasks.
News
In 2024, the release of the 'AsyncIO Toolkit' has made asynchronous programming in Python more efficient. Similarly, 'React Quantum' introduces quantum computing concepts to JavaScript, expanding learning opportunities for students.

Instructions

Objective

Write a java assignment program to create hot dog consolidated hiring system.

Requirements and Specifications

program-to-create-hot-dog-consolidated-hiring-system-in-java (1)

Source Code

# U.R. Name # AIST 2120: Programming Assignment 3 #! Python 3 # Submission import re import os import sys if __name__ == '__main__': #Print greeting message print("**** WEST VIRGINIA HOT DOGS CONSOLIDATED HIRING: CURRENT WEEK ****") print() # Check working directory # Get the current working directory cwd = os.getcwd() print(f"The beginning CWD is {cwd}") # Split to get the name of the last folder last_folder = cwd.split('/')[-1] if last_folder != 'Desktop': #desktop = os.path.join(os.path.join(os.environ['USERPROFILE']), 'Desktop') desktop = os.path.join(os.path.join(os.environ['HG_USER']), 'Desktop') print(f"\tTo ensure it resides in one with the HR input files,\n\tit is now {desktop}") os.chdir(desktop) print() # Create a list to store the data data = list() sql_detected = list() # Inser SQL statements detected here # Open firs file with open('WVDogsAuburnHR.txt', 'r') as f: # Read the lines, split them and insert into the list as sublists lines = f.readlines() for line in lines: line = line.strip() line = re.sub('\t+', '\t', line) if line.startswith('SELECT') or line.startswith('DROP') or line.startswith('INSERT INTO'): sql_detected.append(line) else: row = line.split('\t') data.append(row) with open('WVDogsChasHR.txt', 'r') as f: # Read the lines, split them and insert into the list as sublists lines = f.readlines() for line in lines: line = line.strip() line = re.sub('\t+', '\t', line) if line.startswith('SELECT') or line.startswith('DROP') or line.startswith('INSERT INTO'): sql_detected.append(line) else: row = line.split('\t') data.append(row) if len(data) > 0: print("All hiring files successfully opened. Beginning processing.") # Now, process data for sql in sql_detected: print("==> SQL Detected and Removed!") print(f"\t{sql}") print() # No, sort the data by name data = sorted(data, key = lambda x: x[0]) # Finally, write to file with open('WVDogsConsolidatedHiring.txt', 'w+') as fout: # Write header fout.write("{:<20s} {:>25s} {:>35s}\n".format("Employee Name", "Job Title", "Salary or Other Compensation")) fout.write("{:<20s} {:>25s} {:>35s}\n".format("-------------", "---------", "----------------------------")) for row in data: fout.write("{:<20s} {:>25s} {:>35s}\n".format(row[0], row[1], row[2])) print("Both hiring files have been copied to the consolidated file. Commencing data verification") print() # Now, for error check, re-open the output file and print it with open('WVDogsConsolidatedHiring.txt', 'r') as fin: lines = fin.readlines() for line in lines: line = line.strip() print(line) print() print("All files are closed. WVDogsConsolidatedHiring.txt is ready for processing.") print() print("\t\t---------- HIRING REPORT COMPLETE ----------") print() else: print("Hiring files could not be opened. Please check directory.") print("Press ENTER to exit") input() sys.exit(0)

Similar Samples

Explore our expertise with a curated selection of programming homework samples. From introductory exercises to advanced projects, our samples showcase diverse languages and concepts, illustrating our commitment to quality and proficiency. Whether you need assistance in Python, Java, or C++, our samples reflect our dedication to delivering clear, effective solutions.