subject

// Write a program to prompt a user for 3 values and store the values in 3 different strings. // The first string should store the first and last name, second string a number to be added, the 3rd string another number to be added.
// Multiply the 1st number by the 2nd number and display the results.
// Run 1: "John Doe", "60", "5".
// Run 2: "Mary-Jane Anon", "1212.65", "345.88"
#include using namespace std; int Compute(int val1, int val2, int val3) { int numbers[3]; numbers[0] = val1; numbers[1] = val2; numbers[2] = val3; int result = 0; int i; for (i = 0; i < 3; ++i) { result += numbers[i] - 2; } return result; } int main() { int value1 = 3; int value2 = 4; int value3 = 2; int computedValue; computedValue = Compute(value1, value2, value3); cout << computedValue << endl; return 0; }
//This is my code. I can't quite get it right. I'm trying to implement c-string, but I don't think Im doing/using it correctly. And after entering the second value, it just goes straight to the multiplication part and skips the prompt for the third value. Also, I don't quite understand what it meant "The first string should store the first and last name, second string a number to be added, the 3rd string another number to be added."

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
When building customer relationships through email what should you not do? question 2 options: utilize proper grammar, spelling, and punctuation type in all capital letters use hyperlinks rather than attachments respond to all emails within 24 hours
Answers: 1
question
Computers and Technology, 23.06.2019 04:00
Another name for addicting games.com
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
Describe three characteristics of at-risk drivers. a. b. c. describe three characteristics of safe drivers. a. b. c. describe three driver errors that could cause a collision. a. b. c. how will this information affect you as a driver now and in the future? (2-3 sentences)
Answers: 2
question
Computers and Technology, 24.06.2019 06:30
For which utilities, if any, does the landlord pay?
Answers: 2
You know the right answer?
// Write a program to prompt a user for 3 values and store the values in 3 different strings. // Th...
Questions
question
Mathematics, 20.06.2021 23:50
question
Mathematics, 20.06.2021 23:50
question
Mathematics, 20.06.2021 23:50
question
Social Studies, 20.06.2021 23:50
Questions on the website: 13722363