Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CS 430 Project

March 23, 2023

Instructions

CS430 project creates an application program.

This project can be done on an individual or a group basis. The number of a group SHOULD NOT exceed 3.

In expected circumstances you are fulfilling the programming in your own group with a strong relation to the contents of this course.

Given any input, your system must show the output with necessary explanation. Note that you must implement all functions yourself and must not rely on any language libraries.

Outcomes

●   Source code as a compressed package;

●   input.txt, output.txt;

●   A concise report analyzing the algorithm design, running on some test cases and performances with all group members’ names on it;

   An auxiliary document clarifying the running environment;

●   All the above materials should be submitted in groups (1 submission PER GROUP).

EvAluAtion

   Functional correctness: 10pts;

●   Runnability and robust: 3pts;

   Friendly UI: 2pts;

   Report writing: 5pts.

Due dAte: 4/21/2023 FridAy 23:59 CST

TASKS:

Most profitable purchase.

Problem Description: each merchandise for sale has a ticket price. For example, one     silk flower for $2 and a vase for $5. But stores always provide some promotions for bulk purchase or combinations. For example, 3 silk flowers for $5 or 2 vases+1 silk flower     for $10. Design and implement a program to find out the minimal payment for a purchase.

Input: two .txt files.

(1) input.txt. This file contains the purchase intention and organized as: line1: the number of merchandises to buy;

line2: identifier/code of the first merchandise; amount; ticket price; line3: identifier/code of the first merchandise; amount; ticket price;

 

(2) promotions.txt. This file addresses the promotion information and oragized as: line1: the number of the promotions that are in effect presently;

line2: the number of merchandise types; id1;amount1;id2;amount… promotion price

line3: the number of merchandise types; id1;amount1;id2;amount2…promotion

price

(promotions.txt and price.txt will be provided by your instructor)

Output: one .txt file.

output.txt. This file contains the purchase plan and the optimal amount to pay.

Example:

input.txt

2

7 3 2

8 2 5

promotion.txt

2

1 7 3 5

2 7 1 8 2 10

output.txt

7 2 2

7 1 8 2 10

14