Need help with this C++ homework
I need help problem 1-9 that possible if my wish?
Thank you friend
Tiet
1.)
void showMenu();
2.)
char getChoice();
3.)
double calcResult(double num1,char choice);
4.)
void showResult(double result)
5.)
void getInfo(string& firstname, string& lastname, char& initial);
6.)
void showName(string firstname, string lastname, char initial);
7.)
double calcSquare(double num1);
8.)
bool isPositive(double num1);
9.)
void showMenu(){
cout<<"A.) Multiply a number by 2\n";
cout<<"B.) Divide a number by 2\n";
}
Need help with this C++ homework I need help problem 1-9 that possible if my wish?...
Need help problem 9-13 C++ Homework please help WRITE FUNCTION PROTOTYPES for the following functions. The functions are described below on page 2. (Just write the prototypes) When necessary, use the variables declared below in maino. mm 1.) showMenu m2.) getChoice 3.) calcResult m.) showResult 5.) getInfo mm.) showName 7.) calcSquare 8.) ispositive int main { USE THESE VARIABLES, when needed, to write function prototypes (#1 - #8) double num1 = 1.5; double num2 = 2.5; char choice; double result;...
need help on this! Just write the function prototype for the following finctions while also using the variables below to help write the prototype! thanks!! WRITE FUNCTION PROTOTYPES for the following functions. The functions are described below on page 2. (Just write the prototypes) When necessary, use the variables declared below in main(). I 1.) showMenu 2.) getChoice 3.) calcResult 4.) showResult 5.) getlato 6.) showName 7.) calcSquare 8.) is Positive int main() USE THESE VARIABLES, when needed, to function...
i need help fixing my code. here is the assignment: Make a class that contains the following functions: isLong, isDouble, stringToLong, and stringToDouble. Each receives a string and returns the appropriate type (bool, bool, long, and double).During the rest of the semester you will paste this class into your programs and will no longer use any of the "standard" c# functions to convert strings to numbers. here is my code. it works for the long method but not the double:...
C++ problem where should I do overflow part? in this code do not write a new code for me please /////////////////// // this program read two number from the user // and display the sum of the number #include <iostream> #include <string> using namespace std; const int MAX_DIGITS = 10; //10 digits void input_number(char num[MAX_DIGITS]); void output_number(char num[MAX_DIGITS]); void add(char num1[MAX_DIGITS], char num2[MAX_DIGITS], char result[MAX_DIGITS], int &base); int main() { // declare the array = {'0'} char num1[MAX_DIGITS] ={'0'}; char...
may i ask for help with this c++ problem? this is the code i have for assignment 4 question 2: #include<iostream> #include<string> #include<sstream> #include<stack> using namespace std; int main() { string inputStr; stack <int> numberStack; cout<<"Enter your expression::"; getline(cin,inputStr); int len=inputStr.length(); stringstream inputStream(inputStr); string word; int val,num1,num2; while (inputStream >> word) { //cout << word << endl; if(word[0] != '+'&& word[0] != '-' && word[0] != '*') { val=stoi(word); numberStack.push(val); // cout<<"Val:"<<val<<endl; } else if(word[0]=='+') { num1=numberStack.top(); numberStack.pop(); num2=numberStack.top(); numberStack.pop();...
HELLO EXPERTS, I need a code for this 4 questions.... it's make me crazy now... could you guys help me please? it's java Given two strings, word and a separator sep, return a big string made of count occurrences of the word, separated by the separator string. repeatSeparator("Word", "X", 3)- "WordXWordXWord" repeatSeparator("This", "And", 2)- "ThisAndThis" repeatSeparator("This", "And", 1)- "This"| For example: Result Test System.out.println(repeatSeparator("Pa", "Tn", 4)); PaTnPaTnPaTnPa Consider the series of numbers beginning at start and running up to but...
I need this in C not C++ just C SET-151 C Programming #1 Homework: 7 String Basics – Death by a thousand strings. Reading(s): Chapter(s) in C Primer Plus 1-7, 9, 10 please use this format // ------------------------------------------------------------------------------------------ // Name: Your name here // Class: C Programming // Abstract: Homework 1. // ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------ // Includes // ------------------------------------------------------------------------------------------ #include<stdio.h> #include<stdlib.h> // ------------------------------------------------------------------------------------------ // Constants // ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------ // Prototypes // ------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------ // Name: main //...
What I need: Create a new program named Reverse4 and declare four integer variables with the values 23, 45, 55, and 67. Add a method named Reverse that reverses the positions of four integer variables. The Reverse method should accept the variables as references. Write a Main() method that displays the four variables both before and after reversing them to ensure the method works correctly. What I have: using System; class Reverse4 { public static void reverse(ref int num1, ref...
C== LANGUAGE. Only use iostream and string header file. A bunch of checks i am also giving that needs to be satisfied for the code to be successful if (add("123", "456") != "579") if (add("123", "4") != "127") if (add("1234", "9") != "1243") if (add("88", "12") != "100") if (add("1234567890123456789", "10000000000000999") != "1244567890123457788") string longone(120, '2'); longone[0] = '3'; string longother(123, '1'); longother[0] = '4'; longother[3] = '2'; string longresult(123, '3'); longresult[0] = '4'; longresult[1] = '1'; longresult[2] = '1';...
I couldn't find where to comment. But it has to be written in C++!!!!! Task-1: Rational fractions are of the form a / b, in which a and b are integers and ! ≠ 0. In this exercise, by ‘‘fractions’’ we mean rational fractions. Suppose a / b and c / d are fractions. Arithmetic operations and relational operations on fractions are defined by the following rules: Arithmetic Operations: a/b + c/d = (ad + bc)/bd a/b – c/d =...