Question

guys can you please help me to to write a pseudo code for this program and write the code of the program in visual studio in.cpp.

compile the program and run and take screenshot of the output and upload it. please help is really appreciated.UTF-8CPP Instruction SU2019 LA X 119SU-COSC-1436- C Get Homework Help With Che X Facebook -1.amazonaws.com/blackboard.learn.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

pseudo-Code for calculating the correct average of two numbers when values are initially set.

Declare number1,number2 as INTEGERS
Set number1 to 10
set number2 to 30
Declare average as float
Set avergae to (number1+number2)/2
Print the average to the console.

c++ code for calculating the correct average of two numbers when values are initially set.


#include<iostream>
#include<math.h>
using namespace std;

int main(){

int num1 = 10, num2 =30;
float average;

average = (num1+num2)/2;

cout<<"Average of numbers 10 and 30 is "<<average<<endl;

}

C Compuler Scienice queslion | Che X 4Onling C++ Compiler online ed Prime Videu: The Last Ship: The X X C https://www.onlineg

pseudo-Code for calculating the correct average of two numbers when values are to be given by user.

Declare number1,number2 as INTEGERS
Input number1,number2
Declare average as float
Set avergae to (number1+number2)/2
Print the average to the console.


c++ for calculating the correct average of two numbers when values are to be given by user.

#include<iostream>
#include<math.h>

using namespace std;
int main(){

int num1 , num2 ;
float average;

// cout will the text into the console

cout<<"Enter the value for number 1 "<<endl;

//cin will takes the user input and assigns it to the given variable.
cin>>num1;

// cout will the text into the console

cout<<"Enter the value for number 2"<<endl;

//cin will takes the user input and assigns it to the given variable.
cin>>num2;

average = (num1+num2)/2;

cout<<"Average of numbers 10 and 20 is "<<average<<endl;

}

Your console will look like this after running the above program

Online C++ Compiler- online ed X C Compuler Science question Che X Prime Videu: The Last Ship: The X C https://www.onlinegdb.

Now Enter some value for number 1 and Tap Enter button

Online C++ Compiler- online ed X C Compuler Science question Che X Prime Videu: The Last Ship: The X C https://www.onlinegdb.

Now enter other value for number 2 and Tap Enter button

4Online C++ Compiler online ed C Compuler Science question Che X Prime Videu: The Last Ship: The X X C https://www.onlinegdb.

This is the Final Output.

A sample program on how to initialise a int, float, double, string variables.

#include<iostream>
#include<math.h>
#include<string>

using namespace std;
int main(){
int number = 1;
float numfloat = 1.2;
double numdouble = 1.00;
string str = "yourLabName";

cout<<"Printing integer "<<number<<endl;
cout<<"Printing float number "<<numfloat<<endl;
cout<<"Printing double "<<numdouble<<endl;
cout<<"printing String "<<str<<endl;


}

4Onling C++ Compiler online ed C Compuler Science question Che X Prime Video: The Last Ship: The X X C https://www.onlinegdb.

If you left with any doubt .... feel free to ask.

Add a comment
Know the answer?
Add Answer to:
guys can you please help me to to write a pseudo code for this program and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • please help! Write a program that can be used as a math tutor for a young...

    please help! Write a program that can be used as a math tutor for a young student. The program should display two random numbers to be added. The program should then pause while the student works on the problem. When the student is ready to check the answer, he or she can press a key and the program will display the correct solution. The output must be formatted correctly with the numbers aligned properly. You will build on this assignment...

  • To write a C++ program to find average of three integers using functions Objectives: To get...

    To write a C++ program to find average of three integers using functions Objectives: To get familiar with functions in C++ Task 1: Study the working of user-defined functions in C++ Task 2: To write a C++ program to find average of three integers using functions Programming Instructions: Make new project (Visual C++ Empty Project) named lab6 and add a C++ file named lab6.cpp to this project. (Some IDE may automatically generate main.cpp or source.cpp, then you just rename it...

  • this should be a code for C++ the source code file so the program will operate...

    this should be a code for C++ the source code file so the program will operate as described below. These are the software requirements for the project. When the program runs, it shall display the text as shown on lines 1-11 in the example below. Next, it shall display a prompt message asking the user to enter his or her yearly salary. Next, it shall shall read the user's salary from the keyboard (in the example below, user input is...

  • Topics: Arrays in C. For this assignment, you will write a C program that uses its...

    Topics: Arrays in C. For this assignment, you will write a C program that uses its first command line parameter to compute and display a histogram of characters that occur in it. Requirements: Your program must compile and run correctly using the gcc compiler on ale. You must write the corresponding function definitions for the following function prototypes: // set all elements of the histogram to zero void init_histogram(int histo[]); // construct the histogram from string void cons_histogram(char string[], int...

  • I need this in Net beans and not Python. Part 1 - Pseudo-code Design and write...

    I need this in Net beans and not Python. Part 1 - Pseudo-code Design and write the pseudo-code for the following Problem Statement. Problem Statement A company gives its employees an that will provide one of 3 results based on the following ranges of scores: Score Message on Report 90-100 Special Commendation 70-89 Pass Below 70 Fail Design a single If-Then-Else structure using pseudo-code which displays one of these messages based a score input by a user. Be sure your...

  • can someone please comment through this code to explain me specifically how the variables and arrays...

    can someone please comment through this code to explain me specifically how the variables and arrays are working? I am just learning arrays code is below assignment C++ Programming from Problem Analysis to Program Design by D. S. Malik, 8th ed. Programming Exercise 12 on page 607 Lab9_data.txt Jason, Samantha, Ravi, Sheila, and Ankit are preparing for an upcoming marathon. Each day of the week, they run a certain number of miles and write them into a notebook. At the...

  • Directions: You are to write a C++ program that meets the instruction requirements below. Deliverables: ·...

    Directions: You are to write a C++ program that meets the instruction requirements below. Deliverables: · Your C++ source code file. (The file with the .CPP extension). No other files will be accepted. A screenshot of your program running. Program Instructions: Consider the following incomplete C++ program: #include int main() { … } 1. Write a statement that includes the header files fstream, string, and iomanip in this program. 2. Write statements that declare inFile to be an ifstream variable...

  • Write a C++ program that reads text from a file and encrypts the file by adding...

    Write a C++ program that reads text from a file and encrypts the file by adding 6 to the ASCII value of each character. See section 5.11 in Starting out with C++ for information on reading and writing to text files. Your program should: 1. Read the provided plain.txt file one line at a time. Because this file has spaces, use getline (see section 3.8). 2. Change each character of the string by adding 6 to it. 3. Write the...

  • C++ program: can you help create a autocorrect code using the cpp code provided and the...

    C++ program: can you help create a autocorrect code using the cpp code provided and the words below using pairs, vectors and unordered map: Objectives To practice using C++ std::pair, std::vector, and std::unordered_map To tie together what we've learned into the context of a real-world application used by millions of people every day Instructions For Full Credit You're given a short list of words in known_words_short.txt that contains a handful of very different words. Assume this short list of words...

  • C++ Lab 9B Inheritance Class Production Worker Create a project C2010Lab9b; add a source file Lab...

    C++ Lab 9B Inheritance Class Production Worker Create a project C2010Lab9b; add a source file Lab9b.cpp to the project. Copy and paste the code is listed below: Next, write a class named ProductionWorker that is derived from the Employee class. The ProductionWorker class should have member variables to hold the following information: Shift (an integer) Hourly pay rate (a double) // Specification file for the ProductionWorker Class #ifndef PRODUCTION_WORKER_H #define PRODUCTION_WORKER_H #include "Employee.h" #include <string> using namespace std; class ProductionWorker...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT