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, 23.06.2019 06:30
Which option correctly describes a dbms application? a. software used to manage databases b. software used to organize files and folders c. software used to develop specialized images d. software used to create effective presentations
Answers: 1
question
Computers and Technology, 24.06.2019 03:00
With editing, word automatically displays a paste options button near the pasted or moved text. a. cut-and-paste b. drag-and-drop c. inline d. copy-and-carry
Answers: 1
question
Computers and Technology, 25.06.2019 08:00
Is a major factor in the widespread use of global information systems
Answers: 1
question
Computers and Technology, 25.06.2019 18:30
To deny a host from sending http traffic destined to a specific server you will need to apply a access control list.
Answers: 1
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
Arts, 15.06.2021 23:10
question
Mathematics, 15.06.2021 23:20
question
Mathematics, 15.06.2021 23:20
question
English, 15.06.2021 23:20