What is the output of the following program?
public class Test {
public static void main(String[] args) {
new A();
new B();
}
}
class A {
int i = 7;
public A() {
setI(20);
System.out.println("i from A is " + i);
}
public void setI(int i) {
this.i = 2 * i;
}
}
class B extends A {
public B() {
System.out.println("i from B is " + i);
}
public void setI(int i) {
this.i = 3 * i;
}
}

Answers

Answer 1

Answer:

i from A is 7

Explanation:

Well when you invoke new B (), you got a superclass for that which is A's constructor, and it invokes first. So it displays i from A is 7


Related Questions

Select the correct answer.
What does virtualization do?
A.
It limits the working of the existing operating system.
B.
It creates barriers in cloud storage.
C.
It combines the existing physical servers into one logical server.
D.
It runs any operating system on your existing operating system.

Answers

Answer:

D.it runs any operating system on your existing operating system

Explanation:

because virtualization is a windows version for virtual machine.

With SAN technology, servers use a separate network to communicate with the storage device. Group of answer choices True False

Answers

Answer:

true

Explanation:

Question 2 (6.67 points)
According to many experts, how often should files be backed up?
Once a week
Once a month
Once a year
Daily

Answers

ANSWER
Once a week
ExPLNATION
Because in one month or more everything can happen and in on day you can not use your file for a day so the correct answer is Once a week

What type of trust model is used as the basis for most digital certificates used on the internet?

Answers

The type of trust model that is used as the basis for most digital certificates used on the internet is known to be option B. distributed trust.

What is the trust model of the Internet?

The trust model of the internet is known to be one that is made up of tradeoffs.

Note that Distributed trust is seen as the system that is made up of transactions and it is one that is backed up by an extended community and onw where there is no trusted third parties.

Hence, The type of trust model that is used as the basis for most digital certificates used on the internet is known to be option B. distributed trust.

See full question below

What type of trust model is used as the basis for most digital certificates used on the Internet?

A. third-party trust

B. distributed trust

C. related trust

D. managed trust

Learn more about digital certificates from

https://brainly.com/question/24931496

#SPJ1

In demand paging, when an excessive number of pages are moved back and forth between main memory and secondary storage, it is called ____.

Answers

A thrashing occurs where an excessive number of pages are moved back and forth between main memory and secondary storage,

What is a thrashing?

This is a phenomenon that occurs when the virtual memory is rapidly exchanging data for data on hard disk often at the exclusion of most application-level processing.

Hence, in a computer, the thrashing occurs where an excessive number of pages are moved back and forth between main memory and secondary storage.

Read more about thrashing

brainly.com/question/12978003

#SPJ1


What penalties can occur for a first offense DUI
that did not result in a fatal injury?

Jail time

Must apply for a new license after
revocation

Charged with a felony

Your vehicle impounded

Fines

Alcohol or drug treatment program

Install an Ignition Interlock Device on your car

Suspension or revocation of your driver's license

(Nevada) You check Boxes

Answers

The penalties that  an occur for a first offense DUI that did not result in a fatal injury are:

Your vehicle impounded.Fines.Alcohol or drug treatment program.Suspension or revocation of your driver's license.

What is the penalty for first time DUI?

When a person has a first-offense DUI, the effect for conviction generally is made up of three years of informal probation, fines and taking or completing a first offender alcohol program.

Therefore, The penalties that  an occur for a first offense DUI that did not result in a fatal injury are:

Your vehicle impounded.Fines.Alcohol or drug treatment program.Suspension or revocation of your driver's license.

Learn more about DUI from

https://brainly.com/question/988799

#SPJ1

if ( (ans == 'Y' && errors < 5) || numTries < 10 ) // note uppercase 'Y' count++; Which combinations of values result in count being incremented after the statement is complete?

Answers

The correction options to the case abode are:

Option B. ans = 'Y' (upper case)

errors = 6

numTries = 5

Option C. ans = 'y' (lower case)

errors = 4

numTries = 5

Option D. ans = 'Y' (upper case)

errors = 100

numTries = -1

What is Coding?

Computer coding is known to be the act that entails the use of computer programming languages to instruct the computers and machines on a given number of instructions on what need to be  performed.

Note that in the statement above,  the combinations of values results in count being incremented after the statement is complete is option B, C and D.

See full question below

Learn mode about coding from

https://brainly.com/question/22654163

#SPJ1

Atomic integers in Linux are useful when A) several variables are involved in a race condition. B) a single process access several variable involved in a race condition. C) an integer variable needs to be updated. D) All of the above.

Answers

Atomic integers in Linux are useful when  an integer variable needs to be updated.

What is an Atomic Integer?

This is known to be an applications that is said to be a form of an atomically incremented counters, and it is one which cannot be used as a kind of replacement for any Integer.

Therefore, Atomic integers in Linux are useful when  an integer variable needs to be updated.

Learn more about Atomic integers from

https://brainly.com/question/20515314

#SPJ1

Draw a circuit with a 12-volt battery and two resistors(100 ohms and 200 ohms) in parallel. What is the total resistance of the circuit?

Answers

The total resistance in the circuit is 66.67 ohm.

What is a circuit?

The circuit is a path designed for the flow of current. We can see that the resistors are connected to a common junction (in parallel) as shown in the image attached to this answer.

The total resistance is obtained from;

1/Rt= 1/R1 + 1/R2

1/Rt= 1/200 + 1/100

1/Rt= 0.005 + 0.01

Rt = 66.67 ohm

Learn more about resistance:https://brainly.com/question/21082756

#SPJ1

Answer:

The total resistance in the circuit is 66.67ohm

Got a assignment and need help to do it or figure it out. Its too make 2 python codes that run for
1. Write a program to ask the user to input the number of hours a person has worked in a week and the pay rate per hour.

2. Jennifer wants to carpet her new room with a carpet. Create a program that will work out the area of any sized room, (l x w) Save as area of rectangle.py
Need help with it.

Answers

Answer:

Explanation:

For input,

val = input("Enter your value: ")

print(val)

Haven't done python in while so I can't help with second one.

Your cousin asks you to help her prepare for her computer science exam next week. She gives you two clues about a type of relational database key: No column values may be NULL, and columns must be necessary for uniqueness. Which type of key is she referring to

Answers

In the case above, the type of key that she is referring to composite primary key.

What is the key about?

A primary key is known to be one that is made up of a column, or group of columns and it is often used to know a row.

The composite primary key is made up of multiple columns, known for its uniqueness, and as such In the case above, the type of key that she is referring to composite primary key.

Learn more about composite primary key from

https://brainly.com/question/10167757

#SPJ1

Your task is to design a method int[] allMatches(int[] values, int size, int a, int b) that returns all values between a and b inclusive in the partially filled array values. For example, if an array a contains 11, 3, 9, 4, 2, 5, 4, 7, 6, 0, then the call allMatches(a, 8, 3, 7) should return an array containing 3, 4, 5, 4, 7. Note that the 6 is not included because it is past the size of the partially filled array. Arrange the pseudocode below in the right order. Not all lines are useful.
ArrayValues. Java Tester.
java for (int v: values)
{ public class ArrayValues public static intti allatches(int[1 values, int size, int, int b) {
} for (int k = 0; k < size; k++) {
int v = values[k]; for (int k = 0; k < size; k++) {
int v = values[k]; for (int v: values) {
result[1] = v; 1++;
}
int count = 0; )
} if (a int[] result = new int[count);

Answers

The program that returns all values between a and b inclusive in the partially filled array values is illustrated below.

What is a program?

A computer program means a sequence or set of instructions that is in a programming language for a computer to execute.

Here, the program based on the information given will be:

count = 0

for each v in values

if a <= v <= b

 count++

result = new int[count]

i = 0

for each v in values

if a <= v <= b

 result[i] = v

 i++

return result

Java code:

public class ArrayRange {

public static int[] allMatches(int[] values, int size, int a, int b) {

 int count = 0;

 for (int i = 0; i < size; i++) {

  if(values[i] >= a && values[i] <= b) {

   count++;

  }

 }

 int result[] = new int[count];

 count = 0;

 for (int i = 0; i < size; i++) {

  if(values[i] >= a && values[i] <= b) {

   result[count++] = values[i];

  }

 }

 return result;

}

public static void main(String[] args) {

 int[] a = {11, 3, 9, 4, 2, 5, 4, 7, 6, 0};

 int[] returnedArray = allMatches(a, 8, 3, 7);

 for (int i = 0; i < returnedArray.length; i++) {

  System.out.print(returnedArray[i] + " "

Learn more about program on:

https://brainly.com/question/1538272

#SPJ1

Define a void function named drawDonut to draw a donut that can be called with this syntax: drawDonut( x, y, diameter, color ); The function should draw a circle for the donut at the given position, diameter, and color, then put a white hole in the center at 1/4 of the specified diameter. Make 3 calls to drawDonut in start to make 3 different donuts at different locations, and sizes. Make one donut yellow, another orange, and the last one brown.

Answers

The void function is depicted as given below. See the definition of a void function.

What is a void function?

Void functions are constructed and used in the same way as value-returning functions, except that they do not return a value once the function executes. In place of a data type, void functions utilize the term "void."

A void function executes a task and then returns control to the caller, but it does not return a value.

See the attached for the full solution.

Learn more about void functions at;
https://brainly.com/question/19539019
#SPJ1

You are choosing between two different window washing companies. The first charges $5 per window. The second charges a base fee of $40 plus $3 per window. Based on this information, the second company is cheaper if you have more than ______ windows.

Answers

Answer:

20

Explanation:

Write a program that calculates pay for either an hourly paid worker or a salaried worker Hourly paid workers are paid their hourly pay rate times the number of hours worked. Salaried workers are paid their regular salary plus any bonus they may have earned. The program should declare two structures for the followingdata Hourly Paid Salary Bonus The program should also declare a union with two members. Each member should be a structure variable: one for the hourly paid worker and another for the salaried worker. The union should be part of another structure that also contains a flag for what portion of the union should be used. (If you have questions about this part, please email the instructor) The program should ask the user whether he or she is calculating the pay for an hourly paid worker or a salaried worker. Regardless of which the user selects, the appropriate members of the union will be used to store the data that will be used to calculate the pay Use the following flow structure and functions: Function: Main-Askes user if salaried or hourly. Calls appropriate function based on answer to gather information about the worker. Main should receive a worker pointer back. Main then calls the print function for the worker Function:getHourly-Asks the user for the hourly rate and number of hours worked, storing the answers in a new worker object, which it returns Function getSalaried-Asks the user for the salary and bonus for a worker, storing the answers in a new worker object, which it returns Function printWorker-takes a worker object, and prints out a report for the information about the worker, including the gross pay (which would be calculated) Note: Input validation not required, but would be no negative numbers, and no values greater than 80 for hours worked * Your two structures must be named "hourly" and "salaried", the union should be named Accept both capital and lowercase letters for selecting what type of worker from the user

Answers

The program that is required here is a payroll program. See the explanation below.

What is a program?

A program is a series of instructions that are given to a computer in a predetermined language with precise instruction that delivers a specific output.

What is the required program?

The program that calculates the pay - (Payroll program) is given as follows:

#include <iostream>

#include <iomanip>                                                                                                                                                                                        

using namespace std;

int main ()

{

int paycode;

int WeeklySalary;

double pay;

int HourlySalary;

int TotalHours;

int GrossWeeklySales;

int pieces;

int PieceWage;

cout << "Enter paycode (-1 to end): ";

cin  >> paycode;

while (1); {

               

                switch (paycode) {

                               case '1':

                                cout << "Manager selected." << endl;

                                cout << "Enter weekly salary: ";

                                cin  >> WeeklySalary;

                               

                                cout << endl;

                               

                                pay = WeeklySalary;

                                cout << "The manager's pay is $ " << pay;

                                cout << endl;

                               

                               

                                break;

                               

                                case '2':

                                cout << "Hourly worker selected." << endl;

                                cout << "Enter the hourly salary: ";

                                cin  >> HourlySalary;

                               

                                cout << endl;

                                cout << "Enter the total hours worked: " << endl;

                                cin  >> TotalHours;

                               

                                         if ( TotalHours <= 40)

                                                  pay = HourlySalary * TotalHours;

                                                 

                                         else

                                                  pay = (40.0 * HourlySalary) + (TotalHours - 40) * (HourlySalary * 1.5);

                                                 

                                 

                                cout << endl;

                                cout << "Worker's pay is $ " << pay;

                               

                                cout << endl;

                                break;

                               

                                case '3':

                                cout << "Commission worker selected." << endl;

                                cout << "Enter gross weekly sales: ";

                                cin  >> GrossWeeklySales;

                               

                                cout << endl;

                                pay = (GrossWeeklySales *.57) + 250;

                                 

                                cout << " Commission worker's pay is $ " << pay;

                                 break;  

                               

                                case '4':

                                cout << "Pieceworker selected." << endl;

                                cout << "Enter number of pieces: ";

                                cin  >> pieces;

                               

                                cout << "Enter wage per piece: ";

                                cin >> PieceWage;

                               

                                pay = pieces * PieceWage;

                               

                                cout << "Pieceworker's pay is $ " << pay;

                                break;

                                                               

                         

}

                               

}

system ("pause");

return 0;

}

Learn more about programs at;
https://brainly.com/question/1538272
#SPJ1

True or false: When a change in one key variable causes a change in another key variable, the incremental approach cannot be used for the analysis.

Answers

It is false to state that when a change in one key variable causes a change in another key variable, the incremental approach cannot be used for the analysis.

What is the incremental approach?

An approach this is based on the precept that the ones concerned in a mission have to on the outset attention on the important thing enterprise goals that the mission is to attain and be inclined to suspend detailed consideration of the trivia of a selected solution is known as the incremental approach.

Thus, It is false to state that when a change in one key variable causes a change in another key variable, the incremental approach cannot be used for the analysis.

Learn more about incremental approach:

https://brainly.com/question/14949779

#SPJ1

Andrew likes to know what the weather will be like. To get a weather forecast on his Android smart phone, he has a reminder _______. Andrew thinks of this as a remote control for his app. a. podcast b. network c. widget d. RSS feed

Answers

Andrew has a reminder widget. Andrew thinks of this as a remote control for his app.

What is a widget?

A widget is known to be a kind of element that is used by a graphical user interface (GUI) that shows information or gives a specific way for a user to be able to communicate with the operating system or any kind of application.

Note that Andrew has a reminder widget. Andrew thinks of this as a remote control for his app.

Learn more about widget from

https://brainly.com/question/260819

#SPJ1

which of the following needs to be cited within the text of a paper? select all that apply

Answers

The options that require citations are:

Every work that supports the points you make in your writing. Direct quotations must be cited.Works of individuals whose ideas, theories, or research have directly influenced your work.Works that you have read and whose ideas have been incorporated in your writing.What is the citation?

A “citation” is known to be the method used to inform your readers that some material in your work came are obtained from another source.

Note that The options that require citations are:

Every work that supports the points you make in your writing. Direct quotations must be cited.Works of individuals whose ideas, theories, or research have directly influenced your work.Works that you have read and whose ideas have been incorporated in your writing.

See full question below

Which of the following require citations? Select all that apply.

Group of answer choices

Every work that supports the points you make in your writing.

 Direct quotations must be cited.

Works of individuals whose ideas, theories, or research have directly influenced your work.

Each sentence of a paragraph in your writing requires citation.

Works that you have read and whose ideas have been incorporated in your writing.

Learn more about citation from

https://brainly.com/question/8130130

#SPJ1

An encryption system works by shifting the binary value for a letter one place to the left. "A" then becomes: 1 1 0 0 0 0 1 0 This binary value is then converted to hexadecimal; the hexadecimal value for "A" will be?​

Answers

Answer:

a = 0x61 = 01100001, shifted: 11000010, hex: 0xC2

l = 0x6C = 01101100, shifted: 11011000, hex: 0xD8

g = 0x67= 01100111, shifted: 11001110, hex: 0xCE

Explanation:

The ascii character codes were actually for lowercase letters, whereas the assignment uses uppercase letters.

Write a function called printRange() that accepts two integers as arguments and prints the sequence of numbers between the two arguments, surrounded by brackets ([]) and separated by a comma and a space. Print an increasing sequence if the first argument is smaller than the second; otherwise, print a decreasing sequence. If the two numbers are the same, that number should be printed by itself.

Answers

Answer:

def printRange(start, stop, steps = 1):

   list1 = []

   if steps > start or stop:

       print("Steps is larger than start and stop value")

       return None

   if int(start) < int(stop):

       while start < stop:

           start = start + int(steps)

           list1.append(start)

       print(list1)

   elif start > stop:

       while start > stop:

           stop = stop + int(steps)

           list1.append(stop)

       print(list1)

   elif start == stop:

       print(start)

   else:

       print("Values are not integers.")

for easier viewing:

https://www.codepile.net/pile/e95verLk

If you need help understanding comment below.

Make up a python program that can do the following
Write a program to ask the user to input the number of hours a person has worked in a week and the pay rate per hour.​

Answers

Answer:

hrs=input("Enter Hour:")

rate=input("Eenter Rate per Hour:")

pay=float(hrs)*float(rate)

print("Pay:", pay)

Explanation:

Greg is implementing a data loss prevention system. He would like to ensure that it protects against transmission of sensitive information by guests on his wireless network. What DLP technology would best meet this goal

Answers

The DLP technology that would best meet Greg goal is known as Network-Based DLP technology.

What are Network-Based DLP technology?

Network DLP is known to be a form of device that is often used to hinder vital information from being moved outside any form of corporate network and it is one that is enforced in a lot of regulated industries where compliance requirements are put in place.

Therefore, The DLP technology that would best meet Greg goal is known as Network-Based DLP technology.

Learn more about DLP technology  from

https://brainly.com/question/15177750

#SPJ1

All of the following are true about in-database processing technology EXCEPT Group of answer choices it pushes the algorithms to where the data is. it makes the response to queries much faster than conventional databases. it is often used for apps like credit card fraud detection and investment risk management. it is the same as in-memory storage technology.

Answers

All of the aforementioned are true about in-database processing technology except: D. it is the same as in-memory storage technology.

What is an in-database processing technology?

An in-database processing technology can be defined as a type of database technology that is designed and developed to allow the processing of data to be performed within the database, especially by building an analytic logic into the database itself.

This ultimately implies that, an in-database processing technology is completely different from in-memory storage technology because this used for the storage of data.

Read more on database here: brainly.com/question/13179611

#SPJ1

Is the following statement valid or invalid? Give reason if it is invalid. int 2a = 6:​

Answers

Answer:when the principle die the irrevocable power of attorney is valid or invalid

Explanation:

Question 13 :A college has a learning management system (LMS) application that is in the cloud and maintained by the college IT department. The college has a contract with the company that wrote the LMS software to provide access to the LMS during planned maintenance periods and in the event of a disaster. This service is a cloud-based service as well. What cloud architectural model does the college use

Answers

The cloud architectural model that is being used by the college is hybrid cloud.

The types of cloud computing.

In Computer technology, there are three main types of cloud computing and these include the following:

Private cloudPublic cloudHybrid cloud

Basically, a hybrid cloud combines the features of both a private cloud and public cloud. In this scenario, we can logically deduce that the cloud architectural model that is being used by the college is hybrid cloud because both the college's IT department and the company has access to learning management system (LMS) application hosted in the cloud.

Read more on cloud computing here: https://brainly.com/question/17247526

#SPJ1

A technician is testing a connector in a circuit with a voltmeter. With the power on in the circuit, the meter reads 12 volts when the leads are placed on each side of the connector. This indicates that the connector _____.

Answers

Since the technician is testing a connector in a circuit with a voltmeter and the others, one can say that this indicates that the connector is open.

What does an open connection implies?

Connecting to an open network is one that connote that one can opens their device to others using or on that same wireless network.

Note that Since the technician is testing a connector in a circuit with a voltmeter and the others, one can say that this indicates that the connector is open.

Learn more about open connection from

https://brainly.com/question/5338580

#SPJ1

Explain how any simple substitution cipher that involves a permutation of the alphabet can be thought of as a special case of this cipher.

Answers

A simple substitution cipher takes each vector ([tex]e_i[/tex]) and assigns it to the vectors [[tex]e_{\pi (i)}[/tex]] in a one-to-one function so as to make them equivalent.

What is the Hill cipher?

In 1929, the Hill cipher was invented by Lester S. Hill and it can be described as a poly-graphic substitution cipher that is typically based on linear algebra and it avails a cryptographer an ability to simultaneously operate on more than three (3) symbols.

In Cryptography, the simple substitution cipher is usually viewed as a function which takes each plaintext letter (alphabet) and assigns it to a ciphertext letter. Thus, it takes each vector ([tex]e_i[/tex]) and assigns it to the vectors [[tex]e_{\pi (i)}[/tex]] in a one-to-one function so as to make them equivalent.

Read more on Hill cipher here: https://brainly.com/question/13155546

#SPJ1

Which type of data is used by Cisco Cognitive Intelligence to find malicious activity that has bypassed security controls, or entered through unmonitored channels, and is operating inside an enterprise network

Answers

Cisco Cognitive Intelligence often use statistical data made or use for statistical analysis in order to see malicious activity that has bypassed security controls.

What is statistical data?

This can be seen as Quantitative data that is said to be the output  gotten from an act that quantifies, such as how much. e.g.  weight, height, etc.

Cisco Cognitive Intelligence often use statistical data made or use for statistical analysis in order to see malicious activity that has bypassed security controls.

See options below

alert

session

statistical

transaction

Learn more about statistical data from

https://brainly.com/question/15525560

#SPJ1

C++ code only
Inventory Items:
We're going to do an inventory management system. In the real world, this would use a database, not a file. A single inventory item contains:
item names (or description), like "socks, - red" or "socks - blue". This has to be a character string that WILL include spaces.
item numbers that are unique to the item, similar to UPC codes, like 121821 or 128122. Even though they look like numbers, they are really character strings.
a price, like 4.99, a double.
a quantity on hand, like 13, an integer.
Your program will need to manage arrays of these items.
-----------------------------------------------------------------------------------
Menu:
Your code need to have the following features, all accessible from a menu.
Add a new inventory item to the data into the array in memory. You'll type in the inventory number, description, quantity and price. This will also update the number of items on the menu screen.
List the inventory (in the array in memory) on the screen in neat columns. Display it in chucks of 15 items with a pause in between.
Search the inventory (in the array in memory) for an item by inventory number. If found, print the stored info, otherwise print 'not found'.
Calculate the total value on hand of the inventory (in the array in memory). The sum is the accumulation of all the (quantities * prices).
Save the array in memory to a disk file. It can then be loaded later.
Read from a disk file to the array in memory. This will overwrite the array in memory with new information from the disk. If you data isn't saved, it will be lost. That how is SHOULD work!
----------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------
Menu Sample:
56 items stored
1) Add an item to memory
2) Search memory for an item
3) List what's in memory
4) Total value on hand
5) Save to a file
6) Read in from a file
0) Exit Program
Enter Choice:
-------------------------------------------------------------------------------------------------------------------
How to store the arrays: Parallel Arrays Option
You can maintain 4 arrays, one for each type. You will need to be careful to keep the items in the same position.
string descriptions[1000];
string idNumbers[1000];
float prices[1000];
int quantity[1000];
In this scenario, an item will be spread over the 4 arrays, but all at the same index.
------------------------------------------------------------------------------------------------------------------------------
How to store the data on the disk:
You are required to use the following text based format
Socks - Blue (in the inventory file)
74627204651538
4.99
27
Yellow Socks
25435567456723452345
7.99
27
Each individual item is stored in 4 separate lines. Records follow each other directly.

Answers

Using the computational language C++ it is possible to write a code is possible to create a function that stores items like this:

Writting the code in C++:

//Header files

#include <iostream>

#include <string>

#include <fstream>

using namespace std;

//Class inventoryItem

class inventoryItem

{

public:

//Variable declaration

string itemName;

string itemNumber;

double itemPrice;

int itemQuantity;

};

//implementation of menuItems() function.

void menuItems()

{

// Display the Menu

cout << "=============================\n";

cout << " 1) Add an item to memory\n"

<< " 2) Search memory for an item \n"

<< " 3) List what's in memory\n"

<< " 4) Total value on hand\n"

<< " 5) Save to a file\n"

<< " 6) Read from a file\n"

<< " 0) Exit Program" << endl;

}

//main method.

int main()

{

//variable declaration.

int mnuChoice, cn = 0, d;

string n;

double sum = 0, c;

int temp;

string a, b;

string inputBuffer;

inventoryItem items[100];

ifstream inventoryFile("inventory.txt");

if (inventoryFile)

{

//store the data from the file to memory.

while (!(inventoryFile.eof()))

{

inventoryFile >> items[cn].itemName;

inventoryFile >> items[cn].itemNumber;

inventoryFile >> inputBuffer;

items[cn].itemPrice = atof(inputBuffer.c_str());

inventoryFile >> inputBuffer;

items[cn].itemQuantity = atoi(inputBuffer.c_str());

cn++;

}

inventoryFile.close();

ifstream inventoryFile("inventory.txt");

ofstream fout;

fout.open("inventory.txt");

do

{

menuItems();

cout << cn << " items stored." << endl;

// Prompt and read choice form the user

cout << "Enter your choice: ";

cin >> mnuChoice;

switch (mnuChoice)

{

//Add a new inventory item to the data in memory.

case 1:

// Prompt and read name of the item from the user

cout << "Enter name of the item: ";

cin >> inputBuffer;

items[cn].itemName = inputBuffer;

// Prompt and read itemNumber from the user

cout << "Enter the itemNumber: ";

cin >> inputBuffer;

items[cn].itemNumber = inputBuffer;

// Prompt and read itemPrice from the user

cout << "Enter the itemPrice: ";

cin >> inputBuffer;

items[cn].itemPrice = atof(inputBuffer.c_str());

// Prompt and read itemQuantity from the user

cout << "Enter the itemQuantity: ";

cin >> inputBuffer;

items[cn].itemQuantity = atoi(inputBuffer.c_str());

cn++;

break;

//Search the inventory for an item by inventory number.

case 2:

temp = 0;

cout << "Enter inventory itemNumber: ";

cin >> n;

for (int i = 0; i < cn&&temp != 1; i++)

{

// If found, print the stored info

if (items[i].itemNumber.compare(n) == 0)

{

// Display the stored information

cout << "Item Name" << "\t" << "Item Number" << "\t" << " Item Price" << "\t" << " Item Quantity" << endl;

cout << items[i].itemName << "\t " << items[i].itemNumber << " \t" << items[i].itemPrice << "\t " << items[i].itemQuantity << endl;

temp = 1;

}

}

// otherwise print 'not found'.

if (temp == 0)

{

cout << "Not found!!!" << endl;

}

break;

//List the inventory on the screen

case 3:

cout << "The data in the memory is:" << endl;

cout << "Item Name" << "\t" << "Item Number" << "\t" << " Item Price" << "\t" << " Item Quantity" << endl;

for (int i = 0; i < cn; i++)

{

cout << items[i].itemName << "\t " << items[i].itemNumber << "\t " << items[i].itemPrice << " \t" << items[i].itemQuantity << endl;

}

break;

// Calculate the total value on hand.

case 4:

for (int i = 0; i < cn; i++)

{

// The sum is the accumulation of all the (quantities * prices).

sum += items[i].itemPrice*items[i].itemQuantity;

}

cout << "sum value on hand: " << sum << endl;

break;

// Save the inventory data in the given file

case 5:

for (int i = 0; i < cn; i++)

{

if (i == cn - 1)

{

fout << items[i].itemName << " \t" << items[i].itemNumber << " \t" << items[i].itemPrice << " \t" << items[i].itemQuantity;

}

else

{

fout << items[i].itemName << " \t" << items[i].itemNumber << " \t" << items[i].itemPrice << " \t" << items[i].itemQuantity << endl;

}

}

break;

// Read the data from the file

case 6:

while (!(inventoryFile.eof()))

{

inventoryFile >> a;

inventoryFile >> b;

inventoryFile >> inputBuffer;

c = atof(inputBuffer.c_str());

inventoryFile >> inputBuffer;

d = atoi(inputBuffer.c_str());

// Dsiplays the data in the file

cout << a << " " << b << " " << c << " " << d << endl;

}

break;

}

// Check the menu choice is not equal to 0,

//if it is equal exit from the loop

} while (mnuChoice != 0);

// File closed

fout.close();

inventoryFile.close();

}

// If the inventory file does not exist

// and then display the error message.

else

{

cout << "File does not exist!" << endl;

}

return 0;

}

See more about C++ code at brainly.com/question/17544466

#SPJ1

The users, groups, and roles that have access to a server are called ______________________________.

Answers

Answer:

With the Exclusive Lock, a data item can be read as well as written. Also called write lock. An exclusive lock prevents any other locker from obtaining any sort of a lock on the object. They can be owned by only one transaction at a time

Explanation:

Other Questions
Explain how to make a cheek cell slide Select the correct answer.Why is the nucleus considered the command center of the cell?A. It contains the genetic instructions for every function of the cell.B. It is the cells powerhouse and processes energy for the cell.C. It is the organelle present in both prokaryotic and eukaryotic cells.D. It is responsible for packaging proteins for delivery out of the cells. According to a supply and demand model for apples, if the average household income decreases at the same time ten apple orchards go out of business, one would expect the: a. equilibrium quantity of apples in the market to be indeterminate and the equilibrium price of apples to increase. b. equilibrium price of apples to be indeterminate and the equilibrium quantity of apples in the market to increase. c. equilibrium quantity of apples in the market to decrease and the equilibrium price of apples to be indeterminate. d. equilibrium quantity of apples in the market to decrease and the equilibrium price of apples to stay the same. e. equilibrium price of apples to increase and the equilibrium quantity of apples in the market to decrease. Hierarchies and schemes are important for? The Nash equilibrium in an oligopolistic market is generally ________ for society than the outcome under collusion because the price is ________ marginal cost. a. better; closer to b. worse; equal to c. better; further above d. worse; further above What word is being modified by the number in the following sentences?More than three hundred people wait outside the store to take advantage of the discounts. Than wishest should be undone.' Hie thee hither.That I may pour my spirits in thine ear;And chastise with the valour of my tongueAll that impedes thee from the golden round.Which fate and metaphysical aid doth seemTo have thee crown'd withal.(Enter a Messenger)What is your tidings?What does Lady Macbeth mean by "metaphysical aid" in line 29 of the passage?A. laborB.witchcraftOC. destinyO D. nature What is the down payment for this vehicle: $37,850.00 at 7% down Some taxonomists have developed an alternate system of classification in which tarsiers, monkeys, apes, and humans are placed together in the suborder Group of answer choices Prosimii. Lorisoidea. Haplorhini. Strepsirhini. Calculate the pH of 720. mL of a 0.425-M solution of hydrocyanic acid before and after the addition of 0.249 mol of sodium cyanide. 4. Evaluate how well you think you exposed falsehoods and replaced these withthe truth. If you had another opportunity, what would you do differently? Why?(5) The height "h" of a ball thrown straight up with a velocity of 88 ft/s is given by h = -16t^2 + 88t where "t" is the time it is in the air. For how many seconds the ball is in the air before it hits the ground? Tape worms and Lice examples of blank that can cause diseases in humans Von Steuben said the Americans at Valley Forge were different from troops in Austriaand France. Explain. Before going on his first business trip to China, Albert asked his Chinese American friend to advise him on customs and values common among the Chinese businesspeople he will likely encounter. Albert is trying to avoid ________ business blunders. HELP PLSSS what sport can you Compare and contrast a sport that is played in two different parts of the world and Describe how differently it is played in the two regions, and the impact it has on the two societies. 6. Construct the Truth Table and Determine whether each of the following compound proposition is a Tautology, Contradiction or Contingency. I need help to find the justification for this problem! HELP ASAP!!!REASONS ONLYGiven: ABCD is a parallelogram, FC is congruent to EC, DE bisects BC and BF bisects DC Prove: ABCD is a rhombus Which best explains whether a triangle with side lengths 2 in., 5 in., and 4 in. is an acute triangle?The triangle is acute because 22 + 52 > 42.The triangle is acute because 2 + 4 > 5.The triangle is not acute because 22 + 42 < 52.The triangle is not acute because 22 < 42 + 52.