Questions: 11 448

Answers by our Experts: 10 707

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

I drink a lot of coke.I place the empty cans in a series of stacks, all in a straight line. When I view this series of stacks from the front, I can’t always see all the cans, or even all of the stacks, because sometimes a stack can be entirely obscured by a larger stack. When I view the series of stacks from the front, I can infer a minimum number of total cans. I can see each stack that is strictly larger than all the stacks between it and the front of the structure. For each stack I can see, I know how many cans are used to construct that stack. I then total up the number of cans that I know must exist: let’s call this number A. I then say I infer A cans in this structure.Suppose a series of stacks has the following stack sizes, in order from the front to the back: {1, 4, 3, 4, 6, 6, 2}. I’m able to infer 11 cans from this series: I can see the first, second, and fifth stacks (with 1, 4 and 6 cans respectively).Can you write a program that takes a series of stacks, and tells me how many cans I can infer?
declare a character stack
while ( more input is available)
{
read a character
if ( the character is a '(' )
push it on the stack
else if ( the character is a ')' and the stack is not empty )
pop a character off the stack
else
print "unbalanced" and exit
}
print "balanced
write c++ code for the above
Consider the following pseudocode:
declare a stack of characters
while ( there are more characters in the word to read )
{
read a character
push the character on the stack
}
while ( the stack is not empty )
{
write the stack's top character to the screen
pop a character off the stack
}
mplement the following function. You may use the stack template class and the
stack operations of push, pop, peek, is_empty, and size. You may also use cin.peek( )
and use "cin>>i" to read an integer.
int evaluate_postfix_from_cin( )
// Precondition (Which is not checked): The next input line of cin is a
// properly formed postfix expression consisting of integers,
// the binary operations + and -, and spaces.
// Postcondition: The function has read the next input line (including
// the newline) and returned the value of the postfix expression.
{
int i;
stack<int> s;
Complete the body of this function. You do not need to check the precondition. You
may use the stack template class
bool balanced(const char p[ ], size_t n)
// Precondition: p[0]...p[n-1] contains n characters, each of which
// is '(', ')', '{' or '}'.
// Postcondition: The function returns true if the characters form a
// sequence of correctly balanced parentheses with each '(' matching
// a ')' and each '{' matching a '}'. Note that a sequence such as
// ( { ) } is NOT balanced because when we draw lines to match the
// parentheses to their partners, the lines cross each other. On the
// other hand, ( { } ) and { ( ) } are both balanced.

Write a Programmer that will develop a software called VACCINE_OPTION, that will determine the correct vaccine for every candidate. The available vaccines are Moderna, mRNA, Johnson & Johnson’s Janssen and Pfizer-BioNTech

The software should determine the type of vaccine a candidate should receive based on their temperature. Use the switch statement to determine the right vaccine for candidate by using their temperature readings

1. 30-33 for Mordena

2. 34-36 mRNA

3. 37-38 Johnson and Johnson’s Janssen

4. 39-40 Pfizer-BioNTech

The program must be able to read temperatures up to four(4) decimal places after the comma and use an appropriate library to convert it to two(2) decimals after the comma,

people that are vaccinated:

Jay Snow 34,37 mRNA

Chris Van 37,66 Johnson and johnson’s Janssen

Charles Smith 32,55 Mordena

Norwell Sky 39,78 pFizer-BioNTech


-Use an appropriate operator to convert an expression to a specified type

-manage the alignments in the summary of your candidates


Write a program that declares a struct to store the data of a baseball player (player’s name, number of home runs, and number of hits). Declare an array of 10 components to store the data of 10 baseball players. Your program must contain a function to input data and a function to output data. Add functions to search the array to find the index of a specific player, and update the data of a player. (You may assume that input data is stored in a file.) Before the program terminates, give the user the option to save data in a file. Your program should be menu driven, giving the user various choice


Create a C++ program that has 3 Stacks.
Insert, into the first stack, all the data above (which is the data of student’s names,
surnames and the marks they obtain in a particular assessment)
Display the content of the stack on the screen (console)
Then, remove all the students whose surname starts with the alphabets ‘R’, ‘J’ and
‘M’, from the first stack and insert them into the second Stack.
Write a method that accepts a string and integer n as arguments, the method then displays the passed string n times. Example, if we pass "Testing" as a string and as the integer, function will display ;
Testing
Testing
Testing
Testing
Write a main method demonstrating that the method works correctly by calling it twice, firstly with your first name and last digit on your student number .
How do I write an algorithm, pseudocode and flowchart to find the perimeter and area of a regular polygon
LATEST TUTORIALS
APPROVED BY CLIENTS