Write C program by using the function formats to develop the POS (Point of Sale) program for a B&P
shop which is a small stationary. From analyzing the customer’s requirements, the system analyst can
design details of the program that follow by this:
- Main Function – Get the basic data (date, time, employee name and member point) and calling
the functions that include GetProduct, CalPrice, MemPoint and ShowReceipt.
- GetProduct Function – Get the product details that customer want to buy via keyboard which
include product name, price and number. Program can get product details more than one time
depend on the satisfaction of customer. While the program gets the product details,
it will calculate the total price of all products and send it to the main program.
- CalPrice Function – Get the total price from main program then calculate tax price (10% of
total price) and net price.
- MemPoint Function – Get the total price from main program then calculate the member point
by comparing with the conditions below. In addition, this function has to calculate the total
member point by adding getting point in each time with the latest point.
o Total price >= 2000 get 25 points
o Total price >= 1000 get 15 points
o Total price >= 500 get 10 points
o Total price < 500 get 0 points
- ShowReceipt Function – Clear all input data on monitor and show the receipt of B&P
stationary shop via monitor same with the example below.
เขียนโปรแกรม C โดยใช้รูปแบบการพัฒนา POS ( Point of sale ) โปรแกรมสำหรับ B & P
ร้านซึ่งมีขนาดเล็กเครื่องเขียน จากการวิเคราะห์ความต้องการของลูกค้า , วิเคราะห์ระบบสามารถ
รายละเอียดการออกแบบของโปรแกรมตามนี้ :
- –หน้าที่หลักได้รับข้อมูลเบื้องต้น ( วันที่ , เวลา , ชื่อพนักงานและจุดสมาชิก ) และเรียกฟังก์ชันที่มี getproduct
,calprice mempoint showreceipt , และ .
- ฟังก์ชัน getproduct –รับรายละเอียดสินค้าที่ลูกค้าต้องการซื้อผ่านทางแป้นพิมพ์ซึ่ง
รวมถึงชื่อสินค้า ราคา และเบอร์ โปรแกรมสามารถรับรายละเอียดสินค้ามากกว่า 1 ครั้ง
ขึ้นอยู่กับความพึงพอใจของลูกค้า ในขณะที่โปรแกรมที่ได้รับรายละเอียดสินค้า
จะคำนวณราคารวมของสินค้าทั้งหมด และส่งไปที่โปรแกรมหลัก
- –ฟังก์ชัน calprice ได้รับราคาทั้งหมดจากโปรแกรมหลักแล้วคำนวณภาษี ( 10% ของราคา
ราคารวมและราคาสุทธิ .
- ฟังก์ชัน mempoint –ได้รับราคาทั้งหมดจากโปรแกรมหลักแล้วคำนวณจุด
สมาชิกโดยการเปรียบเทียบกับเงื่อนไขด้านล่าง นอกจากนี้ ฟังก์ชันนี้จะคำนวณรวม
สมาชิกจุด โดยการเพิ่มการจุดในแต่ละครั้งล่าสุดกับจุด
o ราคารวม > = 2 , 000 จะได้รับ 25 คะแนน
o รวมราคา > = 1 , 000 ได้รับ 15 คะแนน
o รวมราคา > = 500 ได้รับ 10 คะแนน
o รวมราคา < 500 ได้ 0 คะแนน
- ฟังก์ชัน showreceipt –ล้างข้อมูลทั้งหมดบนหน้าจอและแสดงใบเสร็จของ B & P
เครื่องเขียน ร้านผ่านทางจอภาพเดียวกันกับตัวอย่างด้านล่าง
การแปล กรุณารอสักครู่..
