Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Write a program that displays a customised welcome message

0 votes
asked Sep 6, 2018 by SHAMISO TSIKIRA (120 points)

2 Answers

0 votes
answered Sep 6, 2018 by Leroy (390 points)
edited Sep 6, 2018 by Leroy
https://onlinegdb.com/SJFmMIRvX

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

///////////////////
using namespace std;
//////////////////

//simple call request with nothing fancy using c++98 basics
void Data_type_1() {

//Delete setsw if it looks odd or play around with it.
 cout << setw(109)<< "Hello <(^_^,)/n" << endl;           
 cout << setw(120)<<"-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+|"<<endl;
 
 }
 
  void Data_type_2()
 {         //flush flushes the formating of text.
  cout<<setw(5)<<"welcome:"<<endl<< "please type your name:"<<flush;
   // here we decare name a string, and pass in the data, like your name, we then get cin to take the users name
  string name = name;
  cin >> name;
 
 
     if (name == name){
     // then we out put the users name on the right side.
     cout<<"--------------hi-------------|"<<name<<endl;
     cout << setw(35)<< "//^_^)> Pass|" << endl;
     cout<<"----------------------------------|"<<endl;
     cout<<setw(21)<< setprecision(0) <<sizeof(name)
     <<":bytes|96bits|information"<<endl;
    
     }else if(name != name){
 cout<<"---------------------------------------------|"<<endl;
     cout << setw(116)<< " error1| " << endl;
 cout<<"---------------------------------------------|"<<endl;
     }
     return;
 }
  
 
 void Data_type_3()
 {
     int sum1;
   cout<<"-+-+-+-+-+please-type--two numbers+-+-<(*-*)+-|"<< endl;
   cout << setw (9) << "Number: "<< flush;
   cin >> sum1;
   char cal;
   cout << "+-+-+-+-+-+-+-enter+-+-+-+-+-+-+-+-+-+-+-+-|"<< endl;
   cout<<setw(9)<<
   "Multiply[*]"<<
   "Subtract[-]"<<
   "Addition[+]"<<
   "Divide[/]"<<endl;
    cout <<"Here-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-|"<< endl;
    cout << "^(*-*)>:"<<flush;
    cin >> cal;
    int sum2;
    cout << "-+-+-+-+-+-+-+-+-+-+-+|" << endl;
    cout << setw (9) << "Number: "<< flush;
    cin >> sum2;
    cout << "-+-+-+-+-+-+-+-+-|"<< endl;
    cout << setw(9) << "Result: "<< flush;
   switch(cal) {
       // a switch must have a char a alphbet not a word.
   case  '-':
   // just like in algebra two values are passed from the right to be calculated by the user or program.
   cout << sum1-sum2;
   break;
   case  '+':
   cout << sum1+sum2;
   break;
   case '*':
   cout << sum1*sum2;
   break;
   case '%':
   cout << sum1/sum2;
      
 }
 }
 int main ()

  {
      //each data type is being called.
    Data_type_1();
    Data_type_2();
        Data_type_3();

  
    return 0;   
   
    };
0 votes
answered Sep 6, 2018 by anonymous
public class HelloWorld{

     public static void main(String []args){
      
         {
                     System.out.println("Welcome");

         }
     }
}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...