Related questions
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images
Please answer part two using the following code for part one!
#include <iostream>
using namespace std;
// main function
int main()
{
// declaring a string variable to store the entered text
string Text;
// asking user to input some text
cout<<"Enter Some Text : ";
// taking user input for Text and storing the input in the Text string variable
// using the getline() function to input text
getline(cin , Text);
// print the entered text on the standard output
cout<<"\nYou Entered : "<<Text;
return 0;
}
Please answer part two using the following code for part one!
#include <iostream>
using namespace std;
// main function
int main()
{
// declaring a string variable to store the entered text
string Text;
// asking user to input some text
cout<<"Enter Some Text : ";
// taking user input for Text and storing the input in the Text string variable
// using the getline() function to input text
getline(cin , Text);
// print the entered text on the standard output
cout<<"\nYou Entered : "<<Text;
return 0;
}
- Create a python program that will read two text.file, which will include the adjacency matrix of two alkane. In the end, the program will output their Wiener's index and will indicate which among the two has the higher boiling point. Example ***isobutane.txt*** 0,0,0,10,0,0,10,0,0,11,1,1,0 ***n-butane.txt*** 0,1,0,01,0,1,00,1,0,10,0,1,0 ***wiener.py*** Enter alkane 1 filename: isobutane.txtEnter alkane 2 filename: n-butane.txt Results:isobutane Wiener index: 9n-butane Wiener index: 10Most probably, the boiling point of n-butane is higher than isobutanearrow_forwardWrite a C/C++ program to implement the following PDA. Give the source code and the runtime screen while testing the string aaabbb. START READ, PUSH a POP, READ POP: b. A ab REJECT ACCEPT REJECTarrow_forwardJavaarrow_forward
- Write a java program correctly that will accept a single number from a user that you must store in an integer variable. With the use of for loops and nested for loops you must reproduce the specific pattern illustrated in the figures below. After initializing your variables, you are to retrieve a single integer input from the user and then find the appropriate combination of for loops to display each number exactly as displayed in the two samples below. COMP 248 Lab Exercise 5.3-Section E-F Winter 2018 Due date:Today, at the end of the lab period. Read this entire document before beginning your lab. Make sure to locate and place the PC2Lab Systemon your desktop. The C248LabInstructionForStudents file is available on the H: drive if you don’t remember how to use the system, you should worry about this after completing the question. Nested Loops Triangle Today you are commissioned to write a program that will accept a single number from a user that you must store in an...arrow_forwardExample in Java Write and trace do-while loop.arrow_forwardWrite in C++ please.arrow_forward
- Write a C# Sharp program to swap two numbers.Test Data:Input the First Number : 5Input the Second Number : 6Expected Output:After Swapping :First Number : 6.arrow_forwardComputer Science IN C++ Test it in the main function Create e musicplayer with 3 songs. Play the current song. Play the next song. Play the next song. Play the next song. Play the previous song. Print the list of the songs using bool parameter true. Print the list of the songs using bool parameter falsearrow_forwardThe instructions my prof. wants is this: Write a program that prompts the user for a binary number (from 3 to 8 bits) as a String and converts it to base-10 decimal value. There are several ways to do this in Java but your program must use a for loop and first principles to perform the conversion. Print the base-10 number when the loop ends... He sent me a diagram of the binary scale and i've never seen this scale before so I'm having issues with my program. I CAN'T use array, which is an issue I'm having right now. public static int getDecimal(int binary) { int decimal = 0; int n = 0; while(true) { if(binary == 0) { break; }else { int temp = binary %10; decimal += temp * Math.pow(2, n); binary = binary / 10; n++; } } return decimal; } public static void main(String[] args) { System.out.println("11...arrow_forward
- c++ programming Write a Nested Loop to print the following for any n x n image of odd dimensions Example Output (if n==5):0 0 0 X 00 0 X 0 X0 X 0 X 0X 0 X 0 00 X 0 0 0 Example Output (if n==3):0 X 0X 0 X0 X 0arrow_forwardUse looping in creating a JAVA flowchart. Problem1. Create a flowchart from the given output. *** +++++ *** +++++ *** Problem 2. Write a program that will display all even numbers that are less than a given number. Problem 3. Write a program that will display an n x n box of asterisks, where n is user input. Advanced: Modify your program such that the length and height of the box can be different from each other.arrow_forwardconsider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". Any value that is the same as the immediately preceding value is considered a consecutive duplicate. Write some code that use a loop to read such a sequence of non-negative integers, terminated by a negative number. When the code finishes executing, the number of consecutive duplicates encountered is printed. using Pythonarrow_forward
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education