+ Link For Assignments, GDBs & Online Quizzes Solution |
+ Link For Past Papers, Solved MCQs, Short Notes & More |
Assignment No. 03 CS508- Modern Programming Languages |
Total Marks: 20
Due Date:July31, 2019 |
||
Instructions Please read the following instructions carefully before solving & submitting assignment: It should be clear that your assignment will not get any credit if: · The assignment is submitted after due date. · The submitted assignment does not open or file is corrupt. · The assignment is completely or partially copied from (other student, handouts or internet). · Student ID is not mentioned in the assignment File or name of file is other than student ID. · The assignment is not submitted in .rar format. Uploading instructionsYour submission must include:· Assignment should be in .rar format. · Save your assignment with your ID (e.g. bx180200786.rar). ObjectiveThe objective of this assignment is to give hands on practice on Java programming language.
Lectures Covered: This assignment covers Lecture # 27 – 33 Deadline Your assignment must be uploaded/submitted at or beforeJuly31, 2019. |
|||
Problem Statement:
Make sure to write your id on top of the code file (As shown in the gif file) otherwise your assignment will not be accepted. Create a console application in java, where you will input a paragraph and also input some words and application will match all the words in the given paragraph to output success or failure for all words. 1. First the paragraph will be inserted. 2. Next the user will be asked to input words. 3. Words will be inserted all at once without any space between the words, and words will be comma separated (example shown in the gif file). 4. The application will check each word in the given paragraph and will output success or frailer for each word on a separate line checking must be case sensitive. You can install NetBeans IDE or simple java Compiler to develop application.
Output.gifhas been attached with this Assignment file please observe this file carefully your program’s output must be like this output file.
If you do not submit any of the above mentioned file 50% marks per file will be deducted. |
Tags:
+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)
+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)
+ Click Here to Search (Looking For something at vustudents.ning.com?) + Click Here To Join (Our facebook study Group)kindly share your code here
package main;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
System.out.println("My ID is bcxxxxxxxxx");
System.out.println("Enter the Input Paragraph");
Scanner s = new Scanner(System.in);
String input = s.nextLine();
System.out.println("Enter the Input Word");
String word = s.nextLine();
String str = "";
int occurance = 0;
for(char c : input.toCharArray()) {
str += c;
if(str.length() == word.length()) {
if(str.equals(word)) {
occurance ++;
}
str = str.substring(1);
}
}
if(occurance > 0)
System.out.println("The word is exist");
else
System.out.println("The word is not exist");
}
}
Solution Idea
ye code compile ho jata ha pr run time pr error aa jata ha...
error ha main class is not find
koi btae is ka kia hal ha..
Please give us the code of this program
Code run b ho jata ha or compile b ... par jab paragraph enter karty ha or us ka bad jab words enter karty ha find karny ka liye ka is ma exist karta ha ya nahi to agar aik he word likho ga to sahi btay ga ka word exist karta ha ya nahi magar jab 2 ya zyada words enter karty ha comma separated ka sath to jawab ghalat data ha har bar yahi kahta ha ka words exist nahi karty.
Sir plz code upload kr dain plz sir
public static void main(String[] args) {
System.out.println("My ID is bcxxxxxxxxx");
System.out.println("Enter Paragraph");
Scanner s = new Scanner(System.in);
String input = s.nextLine();
System.out.println("Enter comma separated words");
String word = s.nextLine();
String str = "";
int occurance = 0;
for(char c : input.toCharArray()) {
str += c;
if(str.length() == word.length()) {
if(str.equals(word)) {
occurance ++;
}
str = str.substring(1);
}
}
if(occurance > 0)
System.out.println("The word is exist");
else
System.out.println("The word is not exist");
}
}
CS508 kidr hain,idea solution
public static void main(String[] args) {
System.out.println("My ID is bcxxxxxxxxx");
System.out.println("Enter Paragraph");
Scanner s = new Scanner(System.in);
String input = s.nextLine();
System.out.println("Enter comma separated words");
String word = s.nextLine();
String str = "";
int occurance = 0;
for(char c : input.toCharArray()) {
str += c;
if(str.length() == word.length()) {
if(str.equals(word)) {
occurance ++;
}
str = str.substring(1);
}
}
if(occurance > 0)
System.out.println("The word is exist");
else
System.out.println("The word is not exist");
}
}
#Cs508 step by step idea solution
Where is code and software link. today is extended day.
#Cs508 Assig Solution
© 2021 Created by + M.Tariq Malik.
Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
We have been working very hard since 2009 to facilitate in learning Read More. We can't keep up without your support. Donate.
We are user-generated contents site. All product, videos, pictures & others contents on site don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com Page with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post