Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,474 members, 7,819,730 topics. Date: Monday, 06 May 2024 at 09:53 PM

Hi Guys, Please Help With This Assignment - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Hi Guys, Please Help With This Assignment (666 Views)

Hi Guys! Created A Signup Form Using HTML5/CSS3. Source Code Available. / Please Help Me With This Assignment / Hello Programmers, Please I Need You Help With This Assignment (2) (3) (4)

(1) (Reply) (Go Down)

Hi Guys, Please Help With This Assignment by chikachuks1(m): 12:01am On Nov 05, 2021
Hi guys. I was given an assignment in the class to write a program for c++, but the truth is that I have no single idea on how to go about it, so I came here to seek for help.
Below is the question


Sunic Foods Program
Leo is a SUNIC FOODS customer; on a given day, he paid N2,000 cash and ordered the following items: -  Beans (2 portions/spoons costing N100 each),  Yam Porridge (2 portion @ N300 each),  Moi Moi (4 @ N300 each), and  Big Water (2 bottle @ N150 each).
Write a C++ program that prompts for the clerk’s first name, the above items and quantities ordered; and displays the final transaction similar to the sample receipt below:
*****************************
SUNIC FOODS, OWERRI
FAST FOOD
OWERRI, IMO STATE
Phone: 09083833660
RECEIPT
INV NO: 230719
DATE: 23/07/19, 11:46 a.m.
*****************************
MOI MOI N1200.00
QTY: 4 @ N300.00 each
BIG WATER N150.00
QTY: 1 @ N15O each
----------------------------------------------
SUBTOTAL: N1350.00
TOTAL ITEMS: 5
-----------------------------------------------
CASH: N2000
CUSTOMER BALANCE: N650
CLERK: VIVIAN
Thank You!
Please call again.
*****************************


I'll be sincerely grateful for any help gotten. Thanks
Re: Hi Guys, Please Help With This Assignment by airsaylongcome: 1:36am On Nov 05, 2021
grin

Do you want Nigerian developers to do this assignment for you or developers from "that side"?

Plus your signature says Holiness unto the Lord. Will plagiarism qualify as Holiness? grin

Write out something let us start correcting what ever you write. Let me give you a heads up

 
#include <iostream>
#include <string>
#include <sstream>
using namespace std;

int main() {
double beansPrice = 100.0, porridgePrice=300. 0, moimoiPrice=300.0, waterPrice=150.0;
  int beansQty, porridgeQty, moimoiQty, waterQty;
string clerksName, userInput;

cout << "Enter clerk's name:";
getline (cin, clerksName);

cout << "Enter Beans Quantity (portions/spoons): ";
getline (cin,userInput);
stringstream(mystr) >> beansQty;


  return 0;
}
Re: Hi Guys, Please Help With This Assignment by islamics(m): 9:12pm On Nov 05, 2021
Oga don solve everything finish for you. Just complete am.
airsaylongcome
Any reason why you didn't use cin directly? Instead of using getline.
Re: Hi Guys, Please Help With This Assignment by airsaylongcome: 9:29pm On Nov 05, 2021
islamics:
Oga don solve everything finish for you. Just complete am.

Any reason why you didn't use cin directly? Instead of using getline.

Yeah. For the clerk's name, I tried to cover a scenario where someone enters a first and last name separated by space. If you use just cin in that scenario only takes the first string is registered as input.

For Qty input, I assume a string input of numeric characters which stringstream "converts" to an integer
Re: Hi Guys, Please Help With This Assignment by islamics(m): 11:42pm On Nov 05, 2021
airsaylongcome:


Yeah. For the clerk's name, I tried to cover a scenario where someone enters a first and last name separated by space. If you use just cin in that scenario only takes the first string is registered as input.

For Qty input, I assume a string input of numeric characters which stringstream "converts" to an integer
Thanks for the explanation.
Re: Hi Guys, Please Help With This Assignment by LikeAking: 3:48pm On Nov 07, 2021
Op good luck to you.

Just be patient.

(1) (Reply)

Python Programming Thread / How Can I Understand The 'this' Keyword In Javascript / How Do I Create A Datasource For App On An X86.

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 16
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.