Write a public function that displays a groceryitems values

Assignment Help Computer Engineering
Reference no: EM131843591

Problem

Define a class named GroceryItem. Include private fields that hold an item's stock number, price, quantity in stock, and total value. Write a public function named dataEntry() that calls four private functions. Three of the private functions prompt the user for keyboard input for a value for one of the data fields stock number, price, and quantity in stock. The function that sets the stock number requires the user to enter a value between 1000 and 9999 inclusive; continue to prompt the user until a valid stock number is entered. The functions that set the price and quantity in stock require non-negative values; continue to prompt the user until valid values are entered. Include a fourth private function that calculates the GroceryItem's total value field (price times quantity in stock). Write a public function that displays a GroceryItem's values. Finally, write a main() function that declares a GroceryItem object, assigns values to its fields, and uses the display function.

Reference no: EM131843591

Questions Cloud

Requirements for a random sample : Question: Why are the requirements for a random sample so important for statistical analysis?
Determine what the optimal order quantity is : In the calculation of an optimal policy for an all-units discount schedule, you first compute the EOQ values for each of the three order costs, and you obtain.
Write a main function that declares an array of ten objects : Write a main()function that declares an array of 10 GroceryItem objects. Assign values to all 10 items and display them.
Excel descriptive statistics : Data was collected on how much 8 customers recently spent for lunch at Benny's Café; see the Excel descriptive statistics file below.
Write a public function that displays a groceryitems values : Write a public function that displays a GroceryItem's values. Finally, write a main() function that declares a GroceryItem object, assigns values to its fields.
Numerical values in problem : Use the 68-95-99.7 rule to answer the following questions. NOTE: The numerical values in this problem have been modified for testing purposes.
Find the value-added ratio under the traditional methods : Determine the value-added, non-value-added, and total lead times, and the value-added ratio under the traditional and lean manufacturing methods.
How would you determine the confidence interval : How would you determine the Confidence Interval using the the mean, standard deviation, and sample size? Please describe.
Create a crc card model for the blackjack game : Create a CRC card model for the Blackjack Game. Create a card for each class you identify in the Blackjack Game. Identify any collaborating classes.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Describe the disjunctive normal form

Express each of the different Boolean expressions in disjunctive normal form in four variables using just the NOR operator, with as few NOR operators.

  The springfork amateur golf club has a tournament every

the springfork amateur golf club has a tournament every weekend. the club president has asked you to design two

  Discuss bus, ring and star topologies

summary about each of the following topologies; bus, ring and star topologies

  Define the technology guru for interstate trucking company

You are designing an application at work that transmits data record to another building within the same city. The data records are 500 bytes in length, and your application will send one record every 0.5 seconds.

  Design a clocked d flip flop

Design a clocked D flip-flop, using a modified ECL circuit design, such that the output becomes valid on the negative-going edge of the clock signal.

  Explain time and space complexity in details

What do you mean by performance of algorithm explain time and space complexity in details?

  Discuss the given rlc circuit

(RLC circuit) The circuit in the figure consists of a resistor (R ohms), an inductor (L henrys), a capacitor (C farads), and an initial voltage source.

  Find that exist two elements in s whose sum is exactly x

Since the Computer Science department at Brown believes in doing every- thing through a well defined algorithm, you have to supply these poor guys an algorithm for doing the task, and one that is asymptotically efficient! So, here goes your exact ..

  How the smallest word is at offset 0000

Sort all the words in memory that could be considred to be decimal ASCII-coded numbers. An ASCII-coded word can vary from 3030h (00d) to 3939h (99d). Sort the ASCII words so that the smallest word is at offset 0000.

  How to developing an information management framework

List and describe the steps involved in developing an Information Management framework.

  Design an application that declares three phonecalls

Design an application that declares three PhoneCalls. Set the length of one PhoneCall to 10 minutes, another to 11 minutes, and allow the third object to use the defaut value supplied by the constructor. Then, display each PhoneCall's value.

  Write a program that swaps the elements of an array pairwise

Write a program that swaps the elements of an array pairwise. Start from the left of the array, take 2 elements at a time and swap the two elements. Continue in this fashion until you reach the end of the array.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd