Questions
CPU Company, AMD vs Intel vs ARM Choose product from each company and give recommendations what...

CPU Company, AMD vs Intel vs ARM

Choose product from each company and give recommendations what the companies should do to make them better in future upgrades.

In: Computer Science

Please do this in visual studio C++. Overview In this programming challenge, you will create an...

Please do this in visual studio C++. Overview In this programming challenge, you will create an Employee Tree application. Instructions Begin this assignment by writing your own version of a class template that will create a binary tree that can hold values of any data type. Design an EmployeeInfo class that holds the following employee information: Employee ID Number (int) Employee Name (string) Next, use the template you designed to implement a binary tree whose nodes hold an instance of the EmployeeInfo class. The nodes should be sorted on the Employee ID number. Test the binary tree by inserting nodes with the following information: Employee ID Number Name 1021 John Williams 1057 Bill Witherspoon 2487 Jennifer Twain 3769 Sophia Lancaster 1017 Debbie Reece 1275 George McMullen 1899 Ashley Smith 4218 Josh Plemmons Your program should allow the user to enter an ID number, then search the tree for the number. If the number is found, it should display the employee’s name. If the node is not found, it should display a message indicating so.

In: Computer Science

Write a Python 3 program called “parse.py” using the template for a Python program that we...

Write a Python 3 program called “parse.py” using the template for a Python program that we covered in this module. Note: Use this mod7.txt input file.

Name your output file “output.txt”.

Build your program using a main function and at least one other function.

Give your input and output file names as command line arguments.

Your program will read the input file, and will output the following information to the output file as well as printing it to the screen:

  1. Output the full text of the file
  2. Output the number of words in the file
  3. Output the number of sentences in the file
  4. Output the first sentence in the file
  5. Output the last sentence in the file
  6. Output the length of the first sentence
  7. Output the length of the last sentence

This is mod7.txt

I do not come here as an advocate, because whatever position the suffrage movement may occupy in the United States of America, in England it has passed beyond the realm of advocacy and it has entered into the sphere of practical politics. It has become the subject of revolution and civil war, and so tonight I am not here to advocate woman suffrage. American suffragists can do that very well for themselves. I am here as a soldier who has temporarily left the field of battle in order to explain - it seems strange it should have to be explained, what civil war is like when civil war is waged by women. I am not only here as a soldier temporarily absent from the field at battle; I am here, and that, I think, is the strangest part of my coming, I am here as a person who, according to the law courts of my country, it has been decided, is of no value to the community at all; and I am adjudged because of my life to be a dangerous person, under sentence of penal servitude in a convict prison. It is not at all difficult if revolutionaries come to you from Russia, if they come to you from China, or from any other part of the world, if they are men. But since I am a woman it is necessary to explain why women have adopted revolutionary methods in order to win the rights of citizenship. We women, in trying to make our case clear, always have to make as part of our argument, and urge upon men in our audience the fact, a very simple fact, that women are human beings. Suppose the men of Hartford had a grievance, and they laid that grievance before their legislature, and the legislature obstinately refused to listen to them, or to remove their grievance, what would be the proper and the constitutional and the practical way of getting their grievance removed? Well, it is perfectly obvious at the next general election the men of Hartford would turn out that legislature and elect a new one. But let the men of Hartford imagine that they were not in the position of being voters at all, that they were governed without their consent being obtained, that the legislature turned an absolutely deaf ear to their demands, what would the men of Hartford do then? They couldn't vote the legislature out. They would have to choose; they would have to make a choice of two evils: they would either have to submit indefinitely to an unjust state of affairs, or they would have to rise up and adopt some of the antiquated means by which men in the past got their grievances remedied. Your forefathers decided that they must have representation for taxation, many, many years ago. When they felt they couldn't wait any longer, when they laid all the arguments before an obstinate British government that they could think of, and when their arguments were absolutely disregarded, when every other means had failed, they began by the tea party at Boston, and they went on until they had won the independence of the United States of America. It is about eight years since the word militant was first used to describe what we were doing. It was not militant at all, except that it provoked militancy on the part of those who were opposed to it. When women asked questions in political meetings and failed to get answers, they were not doing anything militant. In Great Britain it is a custom, a time-honoured one, to ask questions of candidates for parliament and ask questions of members of the government. No man was ever put out of a public meeting for asking a question. The first people who were put out of a political meeting for asking questions, were women; they were brutally ill-used; they found themselves in jail before 24 hours had expired. We were called militant, and we were quite willing to accept the name. We were determined to press this question of the enfranchisement of women to the point where we were no longer to be ignored by the politicians. You have two babies very hungry and wanting to be fed. One baby is a patient baby, and waits indefinitely until its mother is ready to feed it. The other baby is an impatient baby and cries lustily, screams and kicks and makes everybody unpleasant until it is fed. Well, we know perfectly well which baby is attended to first. That is the whole history of politics. You have to make more noise than anybody else, you have to make yourself more obtrusive than anybody else, you have to fill all the papers more than anybody else, in fact you have to be there all the time and see that they do not snow you under. When you have warfare things happen; people suffer; the noncombatants suffer as well as the combatants. And so it happens in civil war. When your forefathers threw the tea into Boston Harbour, a good many women had to go without their tea. It has always seemed to me an extraordinary thing that you did not follow it up by throwing the whiskey overboard; you sacrificed the women; and there is a good deal of warfare for which men take a great deal of glorification which has involved more practical sacrifice on women than it has on any man. It always has been so. The grievances of those who have got power, the influence of those who have got power commands a great deal of attention; but the wrongs and the grievances of those people who have no power at all are apt to be absolutely ignored. That is the history of humanity right from the beginning. Well, in our civil war people have suffered, but you cannot make omelettes without breaking eggs; you cannot have civil war without damage to something. The great thing is to see that no more damage is done than is absolutely necessary, that you do just as much as will arouse enough feeling to bring about peace, to bring about an honourable peace for the combatants; and that is what we have been doing. We entirely prevented stockbrokers in London from telegraphing to stockbrokers in Glasgow and vice versa: for one whole day telegraphic communication was entirely stopped. I am not going to tell you how it was done. I am not going to tell you how the women got to the mains and cut the wires; but it was done. It was done, and it was proved to the authorities that weak women, suffrage women, as we are supposed to be, had enough ingenuity to create a situation of that kind. Now, I ask you, if women can do that, is there any limit to what we can do except the limit we put upon ourselves? If you are dealing with an industrial revolution, if you get the men and women of one class rising up against the men and women of another class, you can locate the difficulty; if there is a great industrial strike, you know exactly where the violence is and how the warfare is going to be waged; but in our war against the government you can't locate it. We wear no mark; we belong to every class; we permeate every class of the community from the highest to the lowest; and so you see in the woman's civil war the dear men of my country are discovering it is absolutely impossible to deal with it: you cannot locate it, and you cannot stop it. "Put them in prison," they said, "that will stop it." But it didn't stop it at all: instead of the women giving it up, more women did it, and more and more and more women did it until there were 300 women at a time, who had not broken a single law, only "made a nuisance of themselves" as the politicians say. Then they began to legislate. The British government has passed more stringent laws to deal with this agitation than it ever found necessary during all the history of political agitation in my country. They were able to deal with the revolutionaries of the Chartists' time; they were able to deal with the trades union agitation; they were able to deal with the revolutionaries later on when the Reform Acts were passed: but the ordinary law has not sufficed to curb insurgent women. They had to dip back into the middle ages to find a means of repressing the women in revolt. They have said to us, government rests upon force, the women haven't force, so they must submit. Well, we are showing them that government does not rest upon force at all: it rests upon consent. As long as women consent to be unjustly governed, they can be, but directly women say: "We withhold our consent, we will not be governed any longer so long as that government is unjust." Not by the forces of civil war can you govern the very weakest woman. You can kill that woman, but she escapes you then; you cannot govern her. No power on earth can govern a human being, however feeble, who withholds his or her consent. When they put us in prison at first, simply for taking petitions, we submitted; we allowed them to dress us in prison clothes; we allowed them to put us in solitary confinement; we allowed them to put us amongst the most degraded of criminals; we learned of some of the appalling evils of our so-called civilisation that we could not have learned in any other way. It was valuable experience, and we were glad to get it. I have seen men smile when they heard the words "hunger strike", and yet I think there are very few men today who would be prepared to adopt a "hunger strike" for any cause. It is only people who feel an intolerable sense of oppression who would adopt a means of that kind. It means you refuse food until you are at death's door, and then the authorities have to choose between letting you die, and letting you go; and then they let the women go. Now, that went on so long that the government felt that they were unable to cope. It was [then] that, to the shame of the British government, they set the example to authorities all over the world of feeding sane, resisting human beings by force. There may be doctors in this meeting: if so, they know it is one thing to feed by force an insane person; but it is quite another thing to feed a sane, resisting human being who resists with every nerve and with every fibre of her body the indignity and the outrage of forcible feeding. Now, that was done in England, and the government thought they had crushed us. But they found that it did not quell the agitation, that more and more women came in and even passed that terrible ordeal, and they were obliged to let them go. Then came the legislation - the "Cat and Mouse Act". The home secretary said: "Give me the power to let these women go when they are at death's door, and leave them at liberty under license until they have recovered their health again and then bring them back." It was passed to repress the agitation, to make the women yield - because that is what it has really come to, ladies and gentlemen. It has come to a battle between the women and the government as to who shall yield first, whether they will yield and give us the vote, or whether we will give up our agitation. Well, they little know what women are. Women are very slow to rouse, but once they are aroused, once they are determined, nothing on earth and nothing in heaven will make women give way; it is impossible. And so this "Cat and Mouse Act" which is being used against women today has failed. There are women lying at death's door, recovering enough strength to undergo operations who have not given in and won't give in, and who will be prepared, as soon as they get up from their sick beds, to go on as before. There are women who are being carried from their sick beds on stretchers into meetings. They are too weak to speak, but they go amongst their fellow workers just to show that their spirits are unquenched, and that their spirit is alive, and they mean to go on as long as life lasts. Now, I want to say to you who think women cannot succeed, we have brought the government of England to this position, that it has to face this alternative: either women are to be killed or women are to have the vote. I ask American men in this meeting, what would you say if in your state you were faced with that alternative, that you must either kill them or give them their citizenship? Well, there is only one answer to that alternative, there is only one way out - you must give those women the vote. You won your freedom in America when you had the revolution, by bloodshed, by sacrificing human life. You won the civil war by the sacrifice of human life when you decided to emancipate the negro. You have left it to women in your land, the men of all civilised countries have left it to women, to work out their own salvation. That is the way in which we women of England are doing. Human life for us is sacred, but we say if any life is to be sacrificed it shall be ours; we won't do it ourselves, but we will put the enemy in the position where they will have to choose between giving us freedom or giving us death. So here am I. I come in the intervals of prison appearance. I come after having been four times imprisoned under the "Cat and Mouse Act", probably going back to be rearrested as soon as I set my foot on British soil. I come to ask you to help to win this fight. If we win it, this hardest of all fights, then, to be sure, in the future it is going to be made easier for women all over the world to win their fight when their time comes.

In: Computer Science

20. Assume you have a Java Interface with a method has this signature: public double min(double......

20. Assume you have a Java Interface with a method has this signature:

public double min(double... grades);

Write the implementation of this method so that it returns the smallest of the grades. Show example on calling the method when you are done with the implementation.

In: Computer Science

COMPUTER SCIENCE- FLOATING POINT REPRESENTATION: Hello, I completed a program for floating point representation (it can...

COMPUTER SCIENCE- FLOATING POINT REPRESENTATION:

Hello, I completed a program for floating point representation (it can add and multiply floating point values in IEEE format). I already completed it, but I came back with 3 small errors. Can someone please fix them? I posted them at the bottom, here is the code:

__________________________________________________________________________________________________________________________________

fp.java:

// fp class
public class fp {

   // add function
public int add(int a, int b) {
FPNumber fa = new FPNumber(a);
FPNumber fb = new FPNumber(b);
FPNumber result = new FPNumber(0);

//***************************************************************************************************
// addition- handle exceptions


if (fa.isNaN() || fb.isNaN()) {
return (fa.isNaN() ? fa : fb).asInt();
}


if (fa.isZero()) {
return fb.asInt();
} else if (fb.isZero()) {
return fa.asInt();
}


if (fa.isInfinity() && fb.isInfinity()) {
if (fa.s() == fb.s()) {
return fa.asInt();
} else {
result.setE(255);
result.setF(1);
return fa.asInt();
}
}


if (fa.isInfinity()) {
return fa.asInt();
} else if (fb.isInfinity()) {
return fb.asInt();
}

//***************************************************************************************************
// addition- sort numbers


FPNumber fa2 = new FPNumber(a);
FPNumber fb2 = new FPNumber(b);


if (fa._e != fb._e) {
fa2 = (fa.e() > fb.e()) ? fa : fb;
fb2 = (fa.e() < fb.e()) ? fa : fb;
} else {
fa2 = (fa.f() > fb.f()) ? fa : fb;
fb2 = (fa.f() < fb.f()) ? fa : fb;
}

//***************************************************************************************************
// addition- align exponents
if (fa2.e() != fb2.e()) {
int shift = fa2._e - fb2._e;
// if the difference between A-B's exponent > 24, return A's value
if (shift > 24) {
return fa2.asInt();
}

long temp = fb2._f >> shift;

fb2.setE(fa2._e);
fb2.setF(temp);

}

//***************************************************************************************************
// addition- add or subtract
long mantissaMod;

// if Asign = Bsign, we add the mantissas
// if Asign ≠ Bsign, we subtract B from A
if (fa2.s() == fb2.s()) {
mantissaMod = fa2.f() + fb2.f();
} else {
mantissaMod = fa2.f() - fb2.f();


if (mantissaMod == 0) {
fa2.setE(0);
fa2.setF(0);

return fa2.asInt();
}
}

result.setS(fa2._s);
//***************************************************************************************************
// addition- normalize
do {
if (((1 << 26) & mantissaMod) != 0) {
mantissaMod >>= 1;
fa2._e++;
}


if (fa2._e >= 255) {
result.setE(255);
result.setF(0);
return result.asInt();
}


while (((1 << 25) & mantissaMod) == 0) {
mantissaMod <<= 1;
fa2._e--;


if (fa2._e <= 0) {
result.setF(mantissaMod >> 1);
result.setE(0);
return result.asInt();
}
}

long low2bit = mantissaMod & 3;
if (low2bit != 0) {
mantissaMod += 4;
}


} while (((1 << 25) & mantissaMod) == 0);

result.setF(mantissaMod);
result.setE(fa2._e);

return result.asInt();
}

//***************************************************************************************************

// multiply function
public int mul(int a, int b){
    FPNumber fa = new FPNumber(a);
    FPNumber fb = new FPNumber(b);
    FPNumber result = new FPNumber(0);

//***************************************************************************************************
// multiply- handle exceptions
if (fa.isNaN() || fb.isNaN()) {
return (fa.isNaN() ? fa : fb).asInt();
}


if(fa.isZero() && fb.isInfinity()){
    result.setE(255);
    result.setF(1);
    return result.asInt();
} else if(fb.isZero() && fa.isInfinity()){
    result.setE(255);
    result.setF(1);
    return result.asInt();
}


result.setS((fa.s() != fb.s()) ? -1 : 1);


if(fa.isZero() || fb.isZero()){
    return result.asInt();
}


if(fa.isInfinity() || fb.isInfinity()){
result.setE(255);
return result.asInt();
}

//***************************************************************************************************
// multiply- add the exponents

// temp exponent value
int temp_e = fa.e() + fb.e() - 127;

if(temp_e > 254) {
result.setE(255);
return result.asInt();
}else if(temp_e < 0) {
return result.asInt();
}
//***************************************************************************************************
// multiply- muliply mantissas


long mantissaMod = fa.f() * fb.f();
mantissaMod >>= 26;
temp_e+=1;

//***************************************************************************************************
// multiplication- normalize

do {
if (((1 << 26) & mantissaMod) != 0) {
mantissaMod >>= 1;
temp_e++;
}
if (temp_e >= 255) {
result.setE(255);
result.setF(0);
return result.asInt();
}


while (((1 << 25) & mantissaMod) == 0) {
mantissaMod <<= 1;
temp_e--;

if (temp_e <= 0) {
result.setF(mantissaMod >> 1);
result.setE(0);

return result.asInt();
}
}

long low2bit = mantissaMod & 3;
if (low2bit != 0) {
mantissaMod += 4;
}

} while (((1 << 25) & mantissaMod) == 0);

result.setF(mantissaMod);
result.setE(temp_e);

return result.asInt();
}

//***************************************************************************************************

// driver class
public static void main(String[] args) {

fp m = new fp();

//***************************************************************************************************
// TESTING THAT LED TO ERRORS

// ERROR 1: add same pos and neg number, result zero (EXPECTED 0, GOT -259.25)

int v129_625 = 0x4301A000; // 129.625
int v_129625 = 0xC301A000; // -129.625

System.out.println(Float.intBitsToFloat(m.add(v129_625, v_129625)) + " should be 0");

// ERROR 2: add plus and minus infinity (EXPECTED NaN, GOT minus infinity)

int vINF = 0x7F800000;
int _vINF = 0xFF800000;

System.out.println(Float.intBitsToFloat(m.add(vINF, _vINF)) + " should be NaN");


// ERROR 3: mul infinity and zero (EXPECTED NaN, GOT zero)

int zero = 0x00000000;


System.out.println(Float.intBitsToFloat(m.add(vINF, zero)) + " should be NaN");


}

}

____________________________________________________________________________________________________

FPNumber.java

public class FPNumber{

   int _s, _e;
   long _f;

   public FPNumber(int a){
       _s = (((a >> 31) & 1) == 1) ? -1 : 1;
       _e = (a >> 23) & 0xFF;
       _f = a & 0x7FFFFF;
   if (_e != 0 && _e != 255){
       _f |= 0x0800000;
   }
       _f <<= 2;
   }

// setters and getters
   public int s(){
       return _s;
   }

   public int e(){
   return _e;
   }

   public long f(){
   return _f;
   }

   public void setS(int val){
   _s = val;
   }

   public void setE(int val){
   _e = val;
   }

   public void setF(long val){
   _f = val;
   }

   public boolean isNaN(){
   return _e == 255 && _f > 0;
   }

   public boolean isInfinity(){
   return _e == 5 && _f == 0;
   }

   public boolean isZero(){
   return _e == 0 && _f == 0;
   }

   public int asInt(){
   return ((_s == -1) ? 0x80000000 : 0) | (_e << 23) | (((int) _f >> 2) & 0x07FFFFF);
   }

}

In: Computer Science

Write a MATLAB program to generate a Gaussian window and apply it to a signal as...

Write a MATLAB program to generate a Gaussian window and apply it to a signal as follows:

  1. 1)Generate a time vector from 0 to 1 seconds with an interval of 0.001 second
  2. 2)Generate two sinusoid signals with a frequency of 90 Hz and 100 Hz, respectively, and add them together
  3. 3)Generate a Gaussian window and apply it to the combined sinusoid signal
  4. 4)Plot an overlay of the original signal and the windowed in the same figure
  5. 5)Add a legend to the figure to identify each signal

In: Computer Science

Course: Big Data Processing Why is the most basic Hadoop deployment at least using Virtualization, what...

Course: Big Data Processing

Why is the most basic Hadoop deployment at least using Virtualization, what happens if we implement Hadoop Without Virtualization, is it possible? What are the consequences if you install Hadoop on a dedicated server?

In: Computer Science

Identify and describe four applications of quantum computing; Explain how regular computing would not be suitable...

Identify and describe four applications of quantum computing; Explain how regular computing would not be suitable for this application and provide a You Tube video(up to 10 min) of each of these applications (200 words).

In: Computer Science

Please in C++ language Write a program that reads 10,000 words into an array of strings....

Please in C++ language

Write a program that reads 10,000 words into an array of strings. The program will then read a second file that contains an undetermined number of words and search the first array for each word. The program will then report the number of words in the second list that were found on the first list.

In: Computer Science

Question 3 - Write a java program named BinaryConversion that will convert base 2 numbers to...

Question 3 - Write a java program named BinaryConversion that will convert base 2 numbers to base 10 numbers.

This complete question is already in chegg study! I want to know the answer for that question?

In: Computer Science

Write a complete Java code that contain two classes. A GradeBook and a GradeBookTester. - The...

Write a complete Java code that contain two classes. A GradeBook and a GradeBookTester.

- The GradeBook class contains the followings:

- An array of grades (integer array) declared as a field.

- A constructor that takes an integer value as parameter (len), and creates the grades array of size equals to len.

- A method called fillArray that fills the grades array with random integers. Acceptable values are between 1 and 100 (inclusive)

- A method called printStatistics that prints 4 values: the average of the grades, the minimum grade, the maximum grade, and the median grade (the middle value of the sorted array).

- The GradeBookTester contains the main and do the followings:

- Uses the input dialog to ask the user to enter an integer value (assume that the user will enter a value that is non-zero and positive / no need to check)

- creates an object of GradeBook class while passing the entered value as parameter.

- calls the functions fillArray and printStatistics for testing.

Please Solve As soon as

Solve quickly I get you thumbs up directly

Thank's

In: Computer Science

important : on regular C programming Write a program for a company called Miller Apartments. The...

important : on regular C programming

Write a program for a company called Miller Apartments. The program will ask the user a series of questions and based on their answers, determine if they have apartments that meet their criteria. You must use functions!
Your main() function must call a function named displayMenu() which will print a welcome message and Menu (see sample output). Your main() function will call a function named millerMain() when option 1 is chosen from the menu. millerMain() will then call a function named inputNumberBedrooms() that will ask the user how many bedrooms they would like. You must validate the data inside the function so that they can only choose between 1 and 4 bedrooms. The number of bedrooms is then returned to the millerMain() function.
Your millerMain() function will then call a function named inputNumberBathrooms() that will ask the user how many bathrooms they would like. You must validate the data inside the function so that they can only choose between 1 or 2 bathrooms. The number of bathrooms is then returned to the millerMain() function.
Next, your millerMain() function will ask the user if they would like utilities included in the rent as a Y or N answer.
After you have all of the information from the user, your millerMain() function will send all of the information to a function called determineRent(). The determineRent() function will use a switch statement to determine the base rent given the following:
​1 bedroom à $600.00​2 bedroom à $750.00
​3 bedroom à $900.00​4 bedroom à $1050.00
Additionally, your determineRent() function will use and if statement to add $50 to the base rent if they asked for 2 bathrooms. Lastly, if they choose to include utilities, then your function will add $50.00 for each bedroom.
Once the rent has been determined, your function will return the rent to millerMain().
Your millerMain() function will ask the user to enter in the maximum amount they would be willing to pay for monthly rent. If the rent is more than what they would be willing to pay, you must specify that the rent is more, give them the amount, and ask if they would like to search again using different criteria. If the rent is not more than what they would be willing to pay, then tell them congratulations. You must also let them know how much their rent will be and whether or not it includes utilities. Then you will display the menu again by exiting millerMain() function and returning to the main() function. (See sample output).

Sample Run #1
----------------------------------------------------------------------
|​​​Welcome to Miller Apartments!​​​​ | ----------------------------------------------------------------------
|​Menu​​​​​​​​​​​ |
|​​New Search:​1​​​​​​​ |
|​​Exit Program:​0​​​​​​​ |
----------------------------------------------------------------------
Enter your choice:​1
How many bedrooms would you like? 1 – 4: 1
How many bathrooms would you like? 1 – 2: 1
Would you like to have utilities included in the rent? Y/N: Y
Enter the maximum amount of rent you are willing to pay: 600.00
Based on your specifications, your total rent of $650.00 is more than your max rent!
Would you like to search using different criteria? Y/N: Y
How many bedrooms would you like? 1 – 4: 1
How many bathrooms would you like? 1 – 2: 1
Would you like to have utilities included in the rent? Y/N: N
Enter the maximum amount of rent you are willing to pay: 600.00
Congratulations! We have an apartment for you to rent!
Your total rent will be $600.00 which does NOT include utilities!
----------------------------------------------------------------------
|​​​Welcome to Miller Apartments!​​​​ | ----------------------------------------------------------------------
|​Menu​​​​​​​​​​​ |
|​​New Search:​1​​​​​​​ |
|​​Exit Program:​0​​​​​​​ |
----------------------------------------------------------------------
Enter your choice:​0
Thank you for choosing Miller Apartments!
Goodbye.
Sample #2:
----------------------------------------------------------------------
|​​​Welcome to Miller Apartments!​​​​ | ----------------------------------------------------------------------
|​Menu​​​​​​​​​​​ |
|​​New Search:​1​​​​​​​ |
|​​Exit Program:​0​​​​​​​ |
----------------------------------------------------------------------
Enter your choice:​1
How many bedrooms would you like? 1 – 4: 6
Invalid number of bedrooms, please try again!
How many bedrooms would you like? 1 – 4: 2
How many bathrooms would you like? 1 – 2: 0
Invalid number of bathrooms, please try again!
How many bathrooms would you like? 1 – 2: 1
Would you like to have utilities included in the rent? Y/N: N
Enter the maximum amount of rent you are willing to pay: 800.00
Congratulations! We have an apartment for you to rent!
Your total rent will be $750.00 which does NOT include utilities!
----------------------------------------------------------------------
|​​​Welcome to Miller Apartments!​​​​ | ----------------------------------------------------------------------
|​Menu​​​​​​​​​​​ |
|​​New Search:​1​​​​​​​ |
|​​Exit Program:​0​​​​​​​ |
----------------------------------------------------------------------
Enter your choice:​0
Thank you for choosing Miller Apartments!
Goodbye.
Sample #3
----------------------------------------------------------------------
|​​​Welcome to Miller Apartments!​​​​ | ----------------------------------------------------------------------
|​Menu​​​​​​​​​​​ |
|​​New Search:​1​​​​​​​ |
|​​Exit Program:​0​​​​​​​ |
----------------------------------------------------------------------
Enter your choice:​1
How many bedrooms would you like? 1 – 4: 1
How many bathrooms would you like? 1 – 2: 1
Would you like to have utilities included in the rent? Y/N: Y
Enter the maximum amount of rent you are willing to pay: 800.00
Congratulations! We have an apartment for you to rent!
Your total rent will be $650.00 which includes utilities!
----------------------------------------------------------------------
|​​​Welcome to Miller Apartments!​​​​ | ----------------------------------------------------------------------
|​Menu​​​​​​​​​​​ |
|​​New Search:​1​​​​​​​ |
|​​Exit Program:​0​​​​​​​ |
----------------------------------------------------------------------
Enter your choice:​0
Thank you for choosing Miller Apartments!
Goodbye.

In: Computer Science

Informational technology has advanced dramatically in recent years at the same time enomous changes in the...

Informational technology has advanced dramatically in recent years at the same time enomous changes in the business world have occurred as companies reflect global competition and more pressure for qualify speed and customer service Did the new technology inspired the business change or it was all the way around?Justify your position

In: Computer Science

Online Store Project Assignment Four Introduction Project Four introduces the ability to read and write data...

Online Store Project Assignment Four

Introduction

Project Four introduces the ability to read and write data to files. This project will create an online store application circa 1990. The application you will build is a standard C++ console project (visual studios). The store will contain basic operations to shop for items, check out of the store, calculate taxes and totals.

All online store applications are “data driven” in that the contents of the store changes over time. In addition, shipping rates change over time. So this project will read shipping rates and tax rates in from a file. It assumes that these rates are based upon the zipcode provided by the user. The sample data for this file is located here:

90001 0.09000 1.55 1.65 1.72

90002 0.09000 1.55 1.65 1.72

90003 0.09000 1.55 1.65 1.72

9000411 0.09000 1.55 1.65 1.72

90005 0.09000 1.55 1.65 1.72

90006 9 1.55 1.65 1.72

90007 0.09000 1.55 1.65 1.72

90008 0.09000 1.55 1.65 1.72

90009 0.09000 1.55 1.65 -1.72

90010 0.09000 1.55 1.65 1.72

90011 0.09000 -1.55 1.65 1.72

90012 0.09000 1.55 1.65 1.72

90013AB 0.09000 1.55 1.65 1.72

90014 0.09000 1.55 1.65 1.72

90015 0.09000 1.55 1.65 1.72

90016 0.09000 1.55 1.65 1.72

90017 0.09000 1.55 1.65 1.72

90018 0.09000 1.55 1.65 1.72

90019 0.09000 1.55 1.65 1.72

90020 0.09000 1.55 1.65 1.72

90021 0.09000 1.55 1.65 1.72

90022 0.09000 1.55 1.65 1.72

90023 0.09000 1.55 1.65 1.72

90024 0.09000 1.55 1.65 1.72

90025 0.09000 1.55 1.65 1.72

90026 0.09000 1.55 1.65 1.72

90027 0.09000 1.55 1.65 1.72

90028 0.09000 1.55 1.65 1.72

90029 0.09000 1.55 1.65 1.72

90030 0.09000 1.55 1.65 1.72

90031 0.09000 1.55 1.65 1.72

90032 0.09000 1.55 1.65 1.72

90033 0.09000 1.55 1.65 1.72

90034 0.09000 1.55 1.65 1.72

90035 0.09000 1.55 1.65 1.72

90036 0.09000 1.55 1.65 1.72

90037 0.09000 1.55 1.65 1.72

90038 0.09000 1.55 1.65 1.72

90039 0.09000 1.55 1.65 1.72

90040 0.09000 1.55 1.65 1.72

90041 0.09000 1.55 1.65 1.72

90042 0.09000 1.55 1.65 1.72

90043 0.09000 1.55 1.65 1.72

90044 0.09000 1.55 1.65 1.72

90045 0.09000 1.55 1.65 1.72

90046 0.09000 1.55 1.65 1.72

90047 0.09000 1.55 1.65 1.72

90048 0.09000 1.55 1.65 1.72

90049 0.09000 1.55 1.65 1.72

90050 0.09000 1.55 1.65 1.72

90051 0.09000 1.55 1.65 1.72

90052 0.09000 1.55 1.65 1.72

90053 0.09000 1.55 1.65 1.72

90054 0.09000 1.55 1.65 1.72

When a consumer checks out of the store with their shopping cart, most eCommerce applications will email an invoice to the customer. Unfortunately, emailing receipts to customers is beyond the scope of this class! So you will need to write the invoice to a file. The format is described below. You will need to upload a sample output file along with the .cpp file.

Steps and Requirements

Follow the steps below to create your program.

  • Display a welcome statement to the user. Come up with a creative name for the store – such as “Hot Tub Time Machine Parts and Supplies”.
  • The main() function should have a loop that displays a menu of shopping options. This is the control loop for the entire program. Once the user decides to check out or exit the store, the loop can stop.
  • The main function will also need to define all of the variables to be passed to the functions listed below. This includes the
    • Customer name, address, city, zipcode
    • Shopping cart/catalog array – the simplest way to track a catalog of items is to define a structure which will contain the item description, the price of the item, the quantity purchased, and the weight of the item. The weight of items can be in ounces or grams (pick one). Then define an array of structures to track the item quantities.
  • Create the following functions and place the function calls at the appropriate spots in the main() program.
    • loadShipping() - load the shipping rates and tax rates from the sample data file. This function should be called once at the beginning of main().
      • This function will receive an array of structures as input. You need to use a structure to save each rate for later use. Define the structure at the top of the program. There will be multiple lines in the file. The function does not have to return anything.
      • The layout of the file is
        • Zipcode taxrate USPSrate UPSrate FedexRate
      • Your function should validate the input data from the file. If data is invalid, skip over that line and proceed to the next line of the file. Things to check for include
        • Zipcode longer than 5 digits
        • Negative or invalid tax and shipping rate values. In project one, you hardcoded a shipping rate for each carrier. The file will now contain the rate (as a real number). When you look at the text file you will see some Los Angeles zipcodes with invalid data. Do NOT fix the data. Your code should handle these problems by displaying an error message and skipping that row of data.
        • The sample file contains all zip codes for California. This is over 2600 zip codes. Your array needs to be at least this big.
        • Hint – Make a copy of the zip code file and delete all lines after line 15. This will create a much smaller set of zip codes to test your program. Once you get everything working, use the main zip code list from Canvas.
    • displayMenu() –It displays the menu options. It does not need any input parameters. It returns the menu choice that the user selected. It should clear the screen each time it is called (hint – one option is to use system(“cls”)). It should validate the user input to make sure they have selected a valid option. The menu should have the following choices:
      • Create Customer Account
      • Shop for Items
      • Proceed to Check Out
      • Exit Store (without buying)
    • createCustomer() – This function prompts for the user’s name and address and saves the results. Input parameters include the name, address, city, and zip. If you choose to use string data types, then you will need to pass by reference. This function does not return anything.
    • maintainCart() – This function allows the user to add an item into their shopping cart. The shopping “cart” is represented by an array. This array is an input parameter to the cart function. Prompt the user with a catalog of items to purchase. You can make up your own list of items with prices that you want to sell (have at least 4-5 items). The user will choose a specific item. Validate the choice. Once a valid choice is made, then ask the user for the quantity to purchase. Save the quantity into the correct array slot. For example,
      • cart[0] – Hut Tub Cover, Price = $150.00
      • cart[1] – Pool Chemicals, Price = $12.00
      • cart[2] – Bubbles, Price = $18.00
      • cart[3] – Time Machine, Price = $4000.00
    • checkOut() – This function will “process” the customer order. In a true eCommerce application, you would charge a credit card and calculate shipping. For this application, the check out consists of calling the following functions. The input parameters are the zipcode, the quantity array. If the zipcode is empty (in the case where the user did not enter their customer info), prompt the user to enter a zipcode at this point.
      • displayReceipt() – This function should loop through all items in the cart and display the item, quantity, price, and extended amounts (price & quantity). This function returns the subtotal of all the items purchased.
      • calculateShipping() – Add up the total weight of all products ordered (quantity > 0). Prompt the user for the shipping method (USPS, UPS, or FEDEX). Based upon their zipcode, find the appropriate rate. Use the following table to calculate the shipping amount. Return this amount from the function.

Weight

Modifier

1-10

1x

11-50

5x

> 50

10x

For example, total weight = 50 ounces shipped via USPS to 90001, results in amount = 5 * 1.55 = $7.55

  • calculateTax() – This function should receive the location of the customer (zipcode) and the subtotal of the order as parameters. Look up the zipcode in the zipcode array to get the tax rate. Calculate the tax amount = subtotal * rate. It should return the tax amount.
  • calculateTotal() – This function should receive the subtotal, shipping amount, and tax amount. It then returns the total. It should verify that the input amounts are valid.

After calling the above functions, the checkOut() routine should display the subtotal, tax, and total amounts to the screen. It should save the invoice or receipt to a file. You should print out the customer name at the top. Follow this with the item descriptions, price, quantity and extended price. Then print the subtotal, tax, shipping, and grand total (on separate lines of the file). Name the file “invoice.txt”.

    • Make sure not to print out any items that may not have been ordered (quantity = 0) from the cart.
  • Extra Credit One (2 points) – Use the C++ date functions to print out the current date in the saveInvoice function. This can be tricky to get formatting correct.
  • Extra Credit Two (4 points) – For the saveInvoice function, save the file in .html format. Use basic tags such as header <h1>, paragraph <p>, lists <ul> to format the invoice. With the HTML format, the grader should be able to double click on the file and have it launch to a browser.

In: Computer Science

Operating System Management kmalloc() Can be used by regular processes as a faster, lower-level version of...

Operating System Management

  1. kmalloc()
    • Can be used by regular processes as a faster, lower-level version of malloc
    • Allocates memory in the kernel with different priorities
    • Only accepts allocation requests that are evenly divisible by the page size
    • Returns the physical address of allocated memory
    • All of the above

In: Computer Science