1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
tensa zangetsu [6.8K]
3 years ago
13

A drink costs 3 dollars. A pizza costs 6 dollars. Given the number of each, compute total cost and assign to totalCost. Ex: 2 dr

inks and 3 pizzas yields totalCost of 24.
let drinkQuantity = 2; // Code tested with values: 2 and 4
let pizzaQuantity = 3; // Code tested with values: 3 and 7
Computers and Technology
1 answer:
steposvetlana [31]3 years ago
5 0

I think it's correct

.

.

.

.

.

.

.

.

.

You might be interested in
Your older brother Max tells you about his secret plan to hack into his college’s computer network and change all of his grades.
viktelen [127]

Answer:

Tell him he could get kicked out of school and it can possibly show up on his record and lessen his chances of finding a job since no one will trust him. He should just focus and get his grades up instead of risking everything and "taking the easy way out".

Explanation:

6 0
2 years ago
What is the advantage of video conferecing
Svet_ta [14]

some advantages of video conferencing include:

• you can talk no matter how far you are from the person

•you won’t have to go somewhere to talk

•there is no cost if you need to travel far

7 0
3 years ago
Read 2 more answers
A_________is an orderly collection of fact & information.
sammy [17]

Answer:

C. Database

Explanation:

4 0
3 years ago
Write a function named replaceSubstring. The function should accept three C-string arguments, let's call them string1, string2,
hoa [83]

Answer:

All is in explanation.

Explanation:

#include <iostream>

#include <cstring>

#include <string>

using namespace std;

//function prototype

string replaceSubstring(const char *, const char *, const char*);

string replaceSubstring(string, string, string);

int main()

{

//declare three char array to hold strings of max 100 chars

char string1[101];

char string2[101];

char string3[101];

//prompt user to enter input

//then read

cout << "Enter string to search:\n";

cin.getline(string1, 101);

cout << "Enter the string you want to replace:\n";

cin.getline(string2, 101);

cout << "What do you want to replace it with?\n";

cin.getline(string3, 101);

cout << "Your updated string is:\n";

cout << replaceSubstring(string1, string2, string3);

//return 0 to mark successful termination

return 0;

}

string replaceSubstring(const char *st1, const char *st2, const char *st3){

//declare pointers start and occurrence

//initialize start with string to search

//char *startSearch = st1;

//initialize occurrence with the first occurrence

//of st2 in st1

char *occurrence = strstr(st1, st2);

//declare empty string

string output = "";

//using occurrence as control for while loop

//means that it will iterate until no more

//occurrences are found

while(occurrence){

//append to final string the characters of st1

//up until first occurrence of st2

output.append(st1, (occurrence-st1));

//append st3 to final string

output.append(st3, strlen(st3));

//update occurrence to point to character

//of st1 just after first occurrence of st2

st1 = st1 + (occurrence-st1) + strlen(st2);

//find new occurrence

occurrence = strstr(st1, st2);

}

//st1 now points to first character after

//last occurrence of st2

output.append(st1, strlen(st1));

return output;

}

string replaceSubstring(string st1, string st2, string st3){

//convert input strings to C-strings

const char *ptr1 = st1.c_str();

const char *ptr2 = st2.c_str();

const char *ptr3 = st3.c_str();

//call function that accepts C-strings

replaceSubstring(ptr1, ptr2, ptr3);

}

6 0
3 years ago
Read 2 more answers
What are the best websites to learn about Java Programing?
vlabodo [156]

Answer:

well you can download some apps from the play store and it is easy for you to learn from there (interactive)

7 0
3 years ago
Other questions:
  • What is the connection between sites that allows for intersite replication called? (Points : 5) Bridgehead server
    12·1 answer
  • How can investors receive compounding returns
    13·1 answer
  • When talking about the physical elements of the internet, the term redundancy refers to:?
    13·1 answer
  • Which is a real-world example of a procedure?
    11·1 answer
  • To the following is not a network connection LAM MAN SAN WAN
    9·1 answer
  • What is the foundational domain for business
    12·1 answer
  • What caused accident? into passive voice​
    13·1 answer
  • Edhesive in JAVA Write a method that takes a String parameter. If the String has a double letter (i.e. contains the same letter
    13·1 answer
  • 4.8 code practice question 1 edhesive
    8·2 answers
  • Information to develop a project network is collected from the.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!