Question

9. Write the code to prompt the User for website name and a domain name. Display the website name, then add “www.” to the begthank you!!

c++

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

9)

Sample Output:

The screenshots are attached below for reference.

Please follow them for proper output.

Output /tmp/YNSFm1Y2r1.O Enter Website name: godaddy Enter Domain name: com www.godaddy.com

Output /tmp/YNSFm1Y2r1.o Enter Website name : godaddy Enter Domain name: .com www.godaddy.com

Program code to copy:


#include <iostream>
using namespace std;
int main() {
string website,domain;
string res="www.";
cout<<"Enter Website name:";
cin>>website;
cout<<"Enter Domain name:";
cin>>domain;//read inputs
res=res+website;
if(domain[0]=='.')//check if . is present in domain name entered
res=res+domain;
else
res=res+"."+domain;
cout<<res;//print the result
return 0;
}

Note:

Please see that as per the guidelines, only single question can be answered when multiple questions are present.

In case of multiple choice type questions, upto 4 can be answered. Thank you.

Please let me know here in the comments section in case of any help needed.

Add a comment
Know the answer?
Add Answer to:
thank you!! c++ 9. Write the code to prompt the User for website name and a...
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
  • I need to create a code for this prompt: In this project we will build a...

    I need to create a code for this prompt: In this project we will build a generic UserInput class for getting keyboard input from the user. Implementation: The class UserInput is a 'Methods only' class, and all the methods should be declared static. Look at the TestScanner.java program at the bottom of this page that inputs a string, int and double. It shows you how to use Scanner class to get input from the keyboard. Write FOUR simple methods, one...

  • In this lab assignment, you'll write code that parses an email address and formats the ci and zip...

    Using Microsoft Visual Studio C# In this lab assignment, you'll write code that parses an email address and formats the ci and zip code portion of an address. String Handling Email: [email protected] Parse City: Fresno State: ca Zp code: 93722 Format ให้ 2 Parsed String Formatted String User name: anne Domain name: murach.comm City, State, Zip: Fresno, CA 93722 OK OK Create a new Windows Forms Application named StringHandling and build the form as shown above. 1. Add code to...

  • C++ Code Writing Prompt: Countdown: Write a countdown program that prompts the user for a max...

    C++ Code Writing Prompt: Countdown: Write a countdown program that prompts the user for a max value (i.e. 30). Print out a countdown from that number down to zero, then print “blast off!”

  • Write a complete program that will prompt the user for an integer You must keep asking...

    Write a complete program that will prompt the user for an integer You must keep asking the user until they give you a number that is greater than 700. Once they give a valid number, display all multiples of 7 from 7 to that number inclusively). You may assume the user will give you correct type of input, but your code must continue to prompt them until they give a number greater than 700.

  • Write a x64 MASM program using ReadConsoleA and WriteConsoleA to prompt the user for their name....

    Write a x64 MASM program using ReadConsoleA and WriteConsoleA to prompt the user for their name. The program should then display the user's name surrounded by asterisks. Allow the name to be up to 30 characters long. Example (user input is boldface, and there are 28 asterisks on the top and bottom lines): What is your name? Kristin Jacobs **************************** *Kristin Jacobs * **************************** Copy / Paste a sample run from the console screen into your .asm file following your...

  • in java Write an application called Squaring that will: • Prompt the user to enter an...

    in java Write an application called Squaring that will: • Prompt the user to enter an integer greater than 1. Your code for this should be type-safe and validate the number, meaning that your code should re-prompt the user for another entry if they enter anything other than an integer that is greater than 1. • Repeatedly square the integer until it exceeds 1 million, outputting the value each time after squaring. • Output the number of squarings required to...

  • Write C code to repeatedly ask the user for a number, then once the user enters...

    Write C code to repeatedly ask the user for a number, then once the user enters 0, the code displays the min, max and average of all values entered. To get proper credit, name the variables as listed below and follow the directions carefully. Do not use any break or similar type of statements. To implement the above code, you will need to count the entries - name the counter variable num_count. You will also need to use a variable,...

  • Three C Code Questions: 5. Write a C program that declares an array of 10 strings,...

    Three C Code Questions: 5. Write a C program that declares an array of 10 strings, each of max length 50 characters, and then reads an entire line of text from the keyboard into each string. 6. Write C code that finds the longest name in this array of strings that you read in Q5. Hint: find the position of the longest string, not the string itself. 7. Write a C program that creates a 4 x 6 two dimensional...

  • Help please this is C/C++ code /* * Lab12, the purpose of this lab is to...

    Help please this is C/C++ code /* * Lab12, the purpose of this lab is to improve your skills in handling c strings * with pointers . * use of : strlen ,string concatenation strcat, compare strcmp, * copy strcpy and search strrchr * */ #include <cstdlib> #include <iostream> #include<cstring> using namespace std; /** * Create a method that prompts the user for only lowercase letters to represent * a name. * Start a Label, then prompt the user to...

  • Write a program in Java that prompts a user for Name and id number. and then...

    Write a program in Java that prompts a user for Name and id number. and then the program outputs students GPA MAIN import java.util.StringTokenizer; import javax.swing.JOptionPane; public class Main {    public static void main(String[] args) {                       String thedata = JOptionPane.showInputDialog(null, "Please type in Student Name. ", "Student OOP Program", JOptionPane.INFORMATION_MESSAGE);        String name = thedata;        Student pupil = new Student(name);                   //add code here       ...

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