A drink costs 2 dollars. A taco costs 3 dollars. Given the number of each, compute total cost and assign totalCost with the result. Ex: 4 drinks and 6 tacos yields totalCost of 26.
*/
int main() {
int numDrinks = 0;
int numTacos = 0;
int totalCost = 0;
numDrinks = 4;
numTacos = 6;
/* Your solution goes here */
totalCost = (2 * numDrinks) + (3 * numTacos);
cout << "Total cost: " << totalCost << endl;
return 0;
}

Answers

Answer 1

Answer:

See Explanation

Explanation:

The question has been answered; however, the program is not dynamic enough because the output will always be 26.

To make it dynamic, replace the following lines of code:

numDrinks = 4;

numTacos = 6;

with:

cout<<"Number of drinks: ";

cin>>numDrinks;

cout<<"Number of Tacos: ";

cin>>numTacos;

The above lines of code will let the user input different values for numDrinks and numTacos each time the program is executed.

Answer 2

Computing the total cost using code can be represented as follows:

def total_cost(no_of_drinks, no_of_talcos):

  totalCost = 2*no_of_drinks + 3*no_of_talcos

  return totalCost

print(total_cost(4, 6))

Python code explanation:

A function named total_cost is declared and it accept the parameters no_of_drinks and no_of_talcos.

The totalCost is used to store the result of the cost of the total drinks and tacos bought in dollars.

Then, we return the totalCost.

Finally, we use the print statement to call the function with its required parameters.

learn more on python code:https://brainly.com/question/14479908?referrer=searchResults

A Drink Costs 2 Dollars. A Taco Costs 3 Dollars. Given The Number Of Each, Compute Total Cost And Assign

Related Questions

Why is it important to know how to create a professional email?

Answers

So people think you are professional based on what you write.

Answer:

It is important to write a professional email because you need to make a good impression. This also shows that you are determined.

What email program would you suggest and why?

Answers

Answer:

An email program

Explanation:

And why?

Answer:

I would suggest g m a i l.

Explanation:

I use G m a i l all the time and I think it is easy to use! A lot of people think it is great too! :)

write a python program to accept a number and check whether it is divisible by 4 or not​

Answers

Answer:

number = int(input("Enter number: "))

if (number % 4):

 print("{} is not divisible by 4".format(number))

else:

 print("{} is divisible by 4".format(number))

Explanation:

If the %4 operation returns a non-zero number, there is a remainder and thus the number is not divisable by 4.

Gamification and virtual reality is the future of education

Answers

Answer:

Education is expected to be the fourth largest sector for VR investment. VR in education is predicted to be a $200 million industry by 2020, and a $700 million industry by 2025. 97% of students would like to study a VR course.

Explanation:

Write a program that reads an integer between o and 1000 and adds all the digits in the integer. For example, if an integer is 932, the sum of all the digits is 14. Hint: Use the % operator to extract digits, and use the / operator to remove the extracted digit. For instance, 932 % 10=2 and 932/10 =93. Here is a sample run:
Enter a number between 0 and 1000 : 999
The sum of digits is 27.

Answers

Answer:

Answered below

Explanation:

#Program is written in Python programming language

digit = 0

sum = 0

num = int(input("Enter a number between 0 and 1000: ")

#Check that number is within the valid range

if num > 0 and num <= 1000:

while num != 0:

#Isolate each digit

digit = num % 10

sum = sum + digit

#Remove isolated digit from number

num = num/10

else:

print("Number is not within valid range")

#print total sum of digits

print(sum)

Intrusion Detection System (IDS) is a security mechanism that detects unauthorized user activities, attacks, and network compromises.

a. True
b. False

Answers

Answer: True

Explanation:

The Intrusion Detection System (IDS) is used for the detection of malicious activities and thus is done by monitoring if the network communications and also the examination of systems logs.

When something looks suspicious of fishy, the Intrusion Detection System scans such thing out. When violations of policy occurs, the Intrusion Detection System is at alert to notice.

Therefore, the answer to the statement in the question is true.

/* missing precondition */

public String getChar(String str, int n) {

return str.substring(n, n 1); }

Write down the most appropriate precondition for the method so that it does not throw an exception.

Answers

Answer:

An appropriate precondition is:

0 <= n && n <= str.length() - 1

Explanation:

Required:

Write down an appropriate pre-condition for the program

From the question, we understand that the method accepts two parameters:

str -> A string value

n -> An integer value which represents the index of character to return from the string str

It should be noted that:

n must be within the range of 0 and str.length()-1

Take for instance:

str = "ABCDE";

n must be within the range 0 to 4 (inclusive) in order not to raise an exception. This is so because the string index starts at 0 and stops at 1 less than the length of the string.

Hence, the precondition can be written as:

0 <= n && n <= str.length() - 1

Which means: n = 0 to length - 1

Write a program that has a user guess a secret number between 1 and 10. Store the secret number in a variable called secretNumber and allow the user to continually input numbers until they correctly guess what secretNumber is. Complete the method guessMyNumber that uses a while loop to ask the user for their guess and compares it againist secretNumber. For example, if secretNumber was 6, an example run of the program may look like this:_______.

Answers

Answer:

Explanation:

The following code is written in Python. It is a function called guessMyNumber and like requested creates a random number and saves it to secretNumber. Then it continuously asks the user for their guess and compares it to the secret number. If the guess is correct it exits the loop otherwise it will continue to ask for a new guess.

import random

def guessMyNumber():

   secretNumber = random.randint(1, 10)

   print(secretNumber)

   while True:

       guess = input("Enter your guess: ")

       guess = int(guess)

       if (guess == secretNumber):

           print("Congratulations you guessed correctly")

Write the command and explain about each formula in MS Excel


1. SUM

2. AVERAGE

3. MAx

4. MIN

5. COUNT

Answers

Answer:

1. SUM  --- The SUM function is used to sum all the values that are in a given range. Thus, for example, if you want to add the values between cells A1 and A3, you must write the following command: =SUM(A1:A10)

2. AVERAGE  --- The AVERAGE function allows you to average a range of values, throwing the average of these values in the cell where the function is typed. For example, if you want to average the values included between B1 and B3, you should write the following function: =AVERAGE (B1: B3).

3. MAX --- The MAX function, for its part, returns the maximum value of the values included in the function. For example, if the maximum value included between the values C1 and C3 is known, the following function must be written: =MAX (C1: C3).

4. MIN  --- The MIN function, in turn, allows to identify the minimum value of the range of values included in the function. For example, if the minimum value included between the values D1 and D3 is known, the following function must be written: =MIN (D1: D3).

5. COUNT --- The COUNT function, finally, is used to count all the cells that have numbers, which have been included in the range of the function. For example, if you want to count all cells that contain numbers between the values E1 and E3, you must write the following function: =COUNT (E1: E3).

What effect would excluding quotation marks from a search phrase have?
A.
It would narrow down the search.
B.
It would have little or no impact on the search.
C.
It would broaden the search.
D.
It would cause the search engine to bring up very different results.

Answers

Answer: C

 it would broaden the search

Explanation:

Placing quotation marks around a search term or phrase limits your search to that exact term or phrase. Without the quotes, your search engine may return all results that contain each separate word. Placing AND between your keywords will return results that only include both or all your keywords.

Answer:

The answer is C. It would broaden the search.

Explanation:

I got it right on the Edmentum test.

Consider the following method, inCommon, which takes two Integer ArrayList parameters. The method returns true if the same integer value appears in both lists at least one time, and false otherwise.
public static boolean inCommon(ArrayList a, ArrayList b)
{
for (int i = 0; i < a.size(); i++)
{
for (int j = 0; j < b.size(); j++) // Line 5
{
if (a.get(i).equals(b.get(j)))
{
return true;
}
}
}
return false;
}
Which of the following best explains the impact to the inCommon method when line 5 is replaced by for (int j = b.size() - 1; j > 0; j--) ?
A. The change has no impact on the behavior of the method.
B. After the change, the method will never check the first element in list b.
C. After the change, the method will never check the last element in list b.
D. After the change, the method will never check the first and the last elements in list b.
E. The change will cause the method to throw an IndexOutOfBounds exception.

Answers

Answer:

The answer is "Option b".

Explanation:

In the given code, a static method "inCommon" is declared, that accepts two array lists in its parameter, and inside the method two for loop is used, in which a conditional statement used, that checks element of array list a is equal to the element of array list b. If the condition is true it will return the value true, and if the condition is not true, it will return a false value. In this, the second loop is not used because j>0 so will never check the element of the first element.

Identify the correct characteristics of Python lists. Check all that apply. Python lists are enclosed in curly braces { }. Python lists contain items separated by commas. Python lists are versatile Python data types. Python lists may use single quotes, double quotes, or no quotes.

Answers

Answer:

Python lists contain items separated by commas.

Python lists are versatile Python data types.

Python lists may uses single quotes, double quotes, or no quotes.

Explanation:

Python Lists are enclosed in regular brackets [ ], not curly brackets { }, so this is not a correct characteristic.

Answer:

a c d

Explanation:

How to do brainliest

Answers

If the reply that someone put has a blue crown you click it and it will give them brainliest but it usually won’t work unless there are two answers

Any1??
Write the names of atleast 22 high-level programming languages

Answers

Answer:

1 Array languages

2 Assembly languages

3 Authoring languages

4 Constraint programming languages

5 Command line interface languages

6 Compiled languages

7 Concurrent languages

8 Curly-bracket languages

9 Dataflow languages

10 Data-oriented languages

11 Decision table languages

12 Declarative languages

13 Embeddable languages

13.1 In source code

13.1.1 Server side

13.1.2 Client side

13.2 In object code

14 Educational languages

15 Esoteric languages

16 Extension languages

17 Fourth-generation languages

18 Functional languages

18.1 Pure

18.2 Impure

19 Hardware description languages

19.1 HDLs for analog circuit design

19.2 HDLs for digital circuit design

20 Imperative languages

21 Interactive mode languages

22 Interpreted languages

23 Iterative languages

Explanation:

what is the significance of the following terms A A L U control unit in the CPU​

Answers

Answer:

Explanation:

The function of ALU is to perform arithmetic operations(add,subtract, multiply,division) as well as logical operations(compare values).

The function of CU is to control and coordinate the activities of the computer.

1.16 LAB: Input and formatted output: House real estate summary Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program with two inputs, current price and last month's price (both integers). Then, output a summary listing the price, the change since last month, and the estimated monthly mortgage computed as (currentPrice * 0.051) / 12 (Note: Output directly. Do not store in a variable.).
Ex: If the input is:
200000 210000
the output is:
This house is $200000. The change is $-10000 since last month.
The estimated monthly mortgage is $850.0.
Note: Getting the precise spacing, punctuation, and newlines exactly right is a key point of this assignment. Such precision is an important part of programming.
import java.util.Scanner;
public class LabProgram {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int currentPrice;
int lastMonthsPrice;
currentPrice = scnr.nextInt();
lastMonthsPrice = scnr.nextInt();
/* Type your code here. */
}

Answers

Answer:

Please find the complete code and the output in the attachement.

Explanation:

In the code, a class "LabProgram" is defined, and inside the main method two integer variable "currentPrice and lastMonthsPrice" is defined that uses the scanner class object is used for a user input value, and in the next step, two print method is declared that print the calculate of the integer variable.

The program is an illustration of output formats in Java

The statements that complete the program are:

System.out.printf("This house is $%d. The change is $%d since last month.\n",currentPrice,(currentPrice - lastMonthsPrice));System.out.printf("The estimated monthly mortgage is $%.1f.\n",(currentPrice * 0.051)/12);

To format outputs in Java programming language, we make use of the printf statement, followed by the string literal that formats the required output

Take for instance:

To output a float value to 2 decimal place, we make use of the literal "%.2f"

Read more about Java programs at:

https://brainly.com/question/25458754

Write a program to insert an array of letters (word), then arrange the letters in ascending order and print this array after the arrangement.​

Answers

Answer:

def split(word):  

   return [char for char in word]

word = input("Enter a word: ")

chars = split(word)

chars.sort()

sorted = ''.join(chars)

print(sorted)

Explanation:

Here is a python solution.

Write a class called TextProcessor that implements the methods listed below. Your implementation may use the charAt() and length() methods from the String class You must not use any other String methods, and you must not use any of the methods in the Character class. You may not use any integer literal values except for 0 and 1.

Answers

Ieisiwizudhrhejwjjsjrjrjje

At Moore High, 456 students attended the prom. This is 65 more students than
the previous year.
To the nearest percent, what is the percent of increase from last year to this
year?
12%
15%
17%
19%

Answers

Answer:

B-15%

Explanation:

Yes I agree the answer is B 15%
Other Questions
Ellos vivieron en una casa pequeaen un apartamento muy grande.(for a while), pero ahora vivenA. despus deB. durante un tiempoC. por ciertoD. en pocas palabras Which statement best explains how the culture of Louisiana was affected by the settlement of Acadians What Mayan city was the largest trading center in Mesoamerica? Find the missing side length Jimmy was walking to get the mail; at which time he fell into a hole and broke his ankle. He has a PPO insurance plan. His total bill was $2,000. If Jimmy has a $1,000 deductible with an 80/20% co-insurance, how much total will Jimmy have to pay out of pocket? Show your work. Help a girl out this is 9th grade math is really appreciate it 4.Han earned $850 over the summer working odd jobs. He wants to put his money into a savings account for when he is ready to buy a car. His bank offers a simple interest account at 5%, how much interest will Han have earned after 2 years?A.$10.00B.$17.00C.$42.50D.$85.00Question 4^5. Han checks with another bank and their interest rate is 4%. Based on your answer in question 4, how much longer will he have to leave his money in the account to earn the same amount of interest as the first bank?A.6 monthsB.1 yearC.2 yearsD.2.5 years Why do you think some ad campaigns work and others don't? HELP HELP HELP 100 POINTS AND ILL GIVE BRAINEILST PLS In 500 words write an essay explaining what you think Sojourner Truth's, "Ain't I A Woman" speech. What was the point of the speech? What did she want to walk away with after she was done? Try and think of a song from a recent artist that you think relates to this speech and why you think they relate. Which spinner could not be used to simulate a baby being born male or female. a spinner 2 equal section. A spinner with 3 equal sections. a spinner with 6 equal sections. A spinner with 10 equal sections solve each system by substitution heeeeeeeeeeelp pleaseeeeeeeeeeee BRAINLIESTTTTTTT!!!!!!!!!!!!! how do hot objects preduce heat The dimensions of a cylindrical water tank are shown below.18 ydo58,320 yd3,240 yd60 ydO19,440 yd15,270 yd3Which of the following is the best estimate of the volume ofthis water tank? the question is:Jeremy is taking a non- calculator quiz in his algebra 1 class. He decided that the equation below had a value of 1.5. Jeremy has the correct value. EXPLAIN how he found this without the use of his calculator. the equation: 2^-1+5^0 Samantha makes a conjecture that the product of two odd integers is always an odd integer. Which choice is the best proof of her conjecture? CLEAR CHECK Look at these different examples: 7 3 = 21, 5 9 = 45, 11 3 = 33. So the product of two odd numbers must be odd. Every time you multiply two odd numbers, the product is an odd number. Let (2a + 1) be an odd number. Let (2b + 1) be another odd number. The product 2(2ab + a + b) + 1 is a multiple of 2 plus 1, which is an odd number. Let a and b both represent odd numbers, and let a b be an odd number. Therefore, a b = b a, which shows that the product of two odd numbers is odd. The perimeter of a rectangle is 160 feet. If the length of the rectangle is 28 feet more than the width, what are the dimensions of the rectangle? I WILL GIVE BRAINLIEST!!!Identify the subject of the following sentence.The mayor said that blueberry muffins are the best kind of muffin.Choose 1 answer:(Choice A)Athe mayor(Choice B)Bblueberry muffins(Choice C)Csaid that blueberry muffins are the best kind of muffin Why are allall other lawssubondineteto the constition